36 |
kaklik |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*************************************************************
|
|
|
4 |
* TorrentFlux - PHP Torrent Manager
|
|
|
5 |
* www.torrentflux.com
|
|
|
6 |
**************************************************************/
|
|
|
7 |
/*
|
|
|
8 |
This file is part of TorrentFlux.
|
|
|
9 |
|
|
|
10 |
TorrentFlux is free software; you can redistribute it and/or modify
|
|
|
11 |
it under the terms of the GNU General Public License as published by
|
|
|
12 |
the Free Software Foundation; either version 2 of the License, or
|
|
|
13 |
(at your option) any later version.
|
|
|
14 |
|
|
|
15 |
TorrentFlux is distributed in the hope that it will be useful,
|
|
|
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
18 |
GNU General Public License for more details.
|
|
|
19 |
|
|
|
20 |
You should have received a copy of the GNU General Public License
|
|
|
21 |
along with TorrentFlux; if not, write to the Free Software
|
|
|
22 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
include_once("config.php");
|
|
|
26 |
include_once("functions.php");
|
|
|
27 |
include_once("AliasFile.php");
|
|
|
28 |
|
|
|
29 |
$torrent = getRequestVar('torrent');
|
|
|
30 |
$error = "";
|
|
|
31 |
$torrentowner = getOwner($torrent);
|
|
|
32 |
$graph_width = "";
|
|
|
33 |
$background = "#000000";
|
|
|
34 |
$alias = getRequestVar('alias');
|
|
|
35 |
if (!empty($alias))
|
|
|
36 |
{
|
|
|
37 |
// read the alias file
|
|
|
38 |
// create AliasFile object
|
|
|
39 |
$af = new AliasFile($cfg["torrent_file_path"].$alias, $torrentowner);
|
|
|
40 |
|
|
|
41 |
for ($inx = 0; $inx < sizeof($af->errors); $inx++)
|
|
|
42 |
{
|
|
|
43 |
$error .= "<li style=\"font-size:10px;color:#ff0000;\">".$af->errors[$inx]."</li>";
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
if ($af->seedlimit <= 0)
|
|
|
47 |
{
|
|
|
48 |
$af->seedlimit = "none";
|
|
|
49 |
}
|
|
|
50 |
else
|
|
|
51 |
{
|
|
|
52 |
$af->seedlimit .= "%";
|
|
|
53 |
}
|
|
|
54 |
}
|
|
|
55 |
else
|
|
|
56 |
{
|
|
|
57 |
die("fatal error torrent file not specified");
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
if ($af->percent_done < 0)
|
|
|
61 |
{
|
|
|
62 |
$af->percent_done = round(($af->percent_done*-1)-100,1);
|
|
|
63 |
$af->time_left = _INCOMPLETE;
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
if($af->percent_done < 1)
|
|
|
67 |
{
|
|
|
68 |
$graph_width = "1";
|
|
|
69 |
}
|
|
|
70 |
else
|
|
|
71 |
{
|
|
|
72 |
$graph_width = $af->percent_done;
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
if($af->percent_done >= 100)
|
|
|
76 |
{
|
|
|
77 |
$af->percent_done = 100;
|
|
|
78 |
$background = "#0000ff";
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
if(strlen($torrent) >= 39)
|
|
|
82 |
{
|
|
|
83 |
$torrent = substr($torrent, 0, 35)."...";
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
$hd = getStatusImage($af);
|
|
|
87 |
|
|
|
88 |
DisplayHead(_DOWNLOADDETAILS, false, "5", $af->percent_done."% ");
|
|
|
89 |
|
|
|
90 |
?>
|
|
|
91 |
<div align="center">
|
|
|
92 |
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
|
93 |
<tr>
|
|
|
94 |
<td align="center">
|
|
|
95 |
<?php
|
|
|
96 |
if ($error != "")
|
|
|
97 |
{
|
|
|
98 |
echo "<img src=\"images/error.gif\" width=16 height=16 border=0 title=\"ERROR\" align=\"absmiddle\">";
|
|
|
99 |
}
|
|
|
100 |
echo $torrent."<font class=\"tiny\"> (".formatBytesToKBMGGB($af->size).")</font>";
|
|
|
101 |
?>
|
|
|
102 |
</td>
|
|
|
103 |
<td align="right" width="16"><img src="images/<?php echo $hd->image ?>" width=16 height=16 border=0 title="<?php echo $hd->title ?>"></td>
|
|
|
104 |
</tr>
|
|
|
105 |
</table>
|
|
|
106 |
<table bgcolor="<?php echo $cfg["table_header_bg"] ?>" width=352 cellpadding=1>
|
|
|
107 |
<tr>
|
|
|
108 |
<td>
|
|
|
109 |
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
|
110 |
<tr>
|
|
|
111 |
<td background="themes/<?php echo $cfg["theme"] ?>/images/proglass.gif"><img src="images/blank.gif" width="<?php echo $graph_width * 3.5 ?>" height="13" border="0"></td>
|
|
|
112 |
<td background="themes/<?php echo $cfg["theme"] ?>/images/noglass.gif" bgcolor="<?php echo $background ?>"><img src="images/blank.gif" width="<?php echo (100 - $graph_width) * 3.5 ?>" height="13" border="0"></td>
|
|
|
113 |
</tr>
|
|
|
114 |
</table>
|
|
|
115 |
</td>
|
|
|
116 |
</tr>
|
|
|
117 |
<tr><td>
|
|
|
118 |
<div align="center">
|
|
|
119 |
<table border="0" cellpadding="2" cellspacing="2" width="90%">
|
|
|
120 |
<tr>
|
|
|
121 |
<td align="right"><div class="tiny"><?php echo _ESTIMATEDTIME ?>:</div></td>
|
|
|
122 |
<td colspan="3" bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".$af->time_left."</strong>" ?></div></td>
|
|
|
123 |
</tr>
|
|
|
124 |
<tr>
|
|
|
125 |
<td align="right"><div class="tiny"><?php echo _PERCENTDONE ?>:</div></td>
|
|
|
126 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".$af->percent_done."%</strong>" ?></div></td>
|
|
|
127 |
<td align="right"><div class="tiny"><?php echo _USER ?>:</div></td>
|
|
|
128 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".$torrentowner."</strong>" ?></div></td>
|
|
|
129 |
</tr>
|
|
|
130 |
<tr>
|
|
|
131 |
<td align="right"><div class="tiny"><?php echo _DOWNLOADSPEED ?>:</div></td>
|
|
|
132 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".$af->down_speed."</strong>" ?></div></td>
|
|
|
133 |
<td align="right"><div class="tiny"><?php echo _UPLOADSPEED ?>:</div></td>
|
|
|
134 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".$af->up_speed."</strong>" ?></div></td>
|
|
|
135 |
</tr>
|
|
|
136 |
<tr>
|
|
|
137 |
<td align="right"><div class="tiny">Down:</div></td>
|
|
|
138 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".formatFreeSpace($af->GetRealDownloadTotal())."</strong>" ?></div></td>
|
|
|
139 |
<td align="right"><div class="tiny">Up:</div></td>
|
|
|
140 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".formatFreeSpace($af->uptotal/(1024*1024))."</strong>" ?></div></td>
|
|
|
141 |
</tr>
|
|
|
142 |
<tr>
|
|
|
143 |
<td align="right"><div class="tiny">Seeds:</div></td>
|
|
|
144 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".$af->seeds."</strong>" ?></div></td>
|
|
|
145 |
<td align="right"><div class="tiny">Peers:</div></td>
|
|
|
146 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".$af->peers."</strong>" ?></div></td>
|
|
|
147 |
</tr>
|
|
|
148 |
<tr>
|
|
|
149 |
<td align="right"><div class="tiny"><?php echo _SHARING ?>:</div></td>
|
|
|
150 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".$af->sharing."%</strong>" ?></div></td>
|
|
|
151 |
<td align="right"><div class="tiny">Seed Until:</div></td>
|
|
|
152 |
<td bgcolor="<?php echo $cfg["body_data_bg"] ?>"><div class="tiny"><?php echo "<strong>".$af->seedlimit."</strong>" ?></div></td>
|
|
|
153 |
</tr>
|
|
|
154 |
<?php
|
|
|
155 |
if ($error != "")
|
|
|
156 |
{
|
|
|
157 |
?>
|
|
|
158 |
<tr>
|
|
|
159 |
<td align="right" valign="top"><div class="tiny">Error(s):</div></td>
|
|
|
160 |
<td colspan="3" width="66%"><div class="tiny"><?php echo "<strong class=\"tiny\">".$error."</strong>" ?></div></td>
|
|
|
161 |
</tr>
|
|
|
162 |
<?php
|
|
|
163 |
}
|
|
|
164 |
?>
|
|
|
165 |
</table>
|
|
|
166 |
</div>
|
|
|
167 |
</td></tr></table>
|
|
|
168 |
<?php
|
|
|
169 |
|
|
|
170 |
DisplayFoot(false);
|
|
|
171 |
|
|
|
172 |
?>
|