1 <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4 <meta http
-equiv
="content-type" content
="text/html; charset=UTF-8">
5 <meta http
-equiv
="pragmas" content
="no-cache">
7 echo "<title>aMule " , amule_get_version(), " - Web Control Panel</title>";
8 if ( $_SESSION["auto_refresh"] > 0 ) {
9 echo "<meta http-equiv=\"refresh\" content=\"", $_SESSION["auto_refresh"],
10 '; url=shared.php', '">';
13 <style type
="text/css">
18 a
, a
:active
, a
:link
, a
:visited
22 .down
-header
, .down
-header
-left
, .down
-header
-right
,
23 .down
-line
, .down
-line
-good
, .down
-line
-left
, .down
-line
-good
-left
,
24 .down
-line
-right
, .down
-line
-good
-right
,
25 .up
-header
, .up
-header
-left
, .up
-line
, .up
-line
-left
,
26 .server
-header
, .server
-header
-left
, .server
-line
, .server
-line
-left
,
27 .shared
-header
, .shared
-header
-left
, .shared
-line
, .shared
-line
-changed
,
28 .shared
-line
-left
, .shared
-line
-left
-changed
,
29 .header
, .smallheader
, .commontext
,
30 .upqueue
-header
, .upqueue
-line
, .upqueue
-line
-left
,
31 .websearch
-header
, .websearch
-line
, .addserver
-header
, .addserver
-line
40 background
-color
: #3399FF;
42 .down
-header
, .down
-line
, .down
-line
-good
, .up
-header
, .up
-line
,
43 .server
-header
, .server
-line
, .shared
-header
, .shared
-line
, .shared
-line
-changed
,
44 .upqueue
-header
, .upqueue
-line
,
45 .websearch
-header
, .websearch
-line
, .addserver
-header
, .addserver
-line
49 .down
-header
-left
, .down
-line
-left
, .down
-line
-good
-left
,
50 .server
-header
-left
, .server
-line
-left
, .shared
-header
-left
,
51 .up
-header
-left
, .up
-line
-left
, .shared
-line
-left
, .shared
-line
-left
-changed
, .upqueue
-line
-left
55 .down
-line
-right
, .down
-line
-good
-right
, .down
-header
-right
59 .down
-header
, .down
-header
-left
, .down
-header
-right
,
60 .up
-header
, .up
-header
-left
, .server
-header
, .server
-header
-left
,
61 .shared
-header
, .shared
-header
-left
, .upqueue
-header
,
62 .websearch
-header
, .addserver
-header
64 background
-color
: #0066CC;
68 background
-color
: #0046AC;
72 background
-color
: #003399;
77 background
-color
: #FFFFFF;
80 .down
-line
, .down
-line
-good
, .down
-line
-left
, .down
-line
-good
-left
,
81 .down
-line
-right
, .down
-line
-good
-right
,
82 .up
-line
, .up
-line
-left
, .server
-line
, .server
-line
-left
,
83 .shared
-line
, .shared
-line
-changed
, .shared
-line
-left
, .shared
-line
-left
-changed
,
84 .upqueue
-line
, .upqueue
-line
-left
,
85 .websearch
-line
, .addserver
-line
87 background
-color
: #3399FF;
89 .down
-line
-good
, .down
-line
-good
-left
, .down
-line
-good
-right
, .shared
-line
-changed
, .shared
-line
-left
-changed
95 border
:0px solid
#000000;
96 border
-collapse
: collapse
;
111 <body bgcolor
="#FBDE9C" text
=white link
="#3399FF" vlink
="#3399FF" alink
="#3399FF" marginwidth
=0 marginheight
=0 topmargin
=0 leftmargin
=0 style
="margin:0px">
112 <table border
=0 width
="100%" align
=center cellpadding
=4 cellspacing
=0>
114 <td
class="tabs" align
="left" colspan
="2">
116 <table border
="0" cellpadding
="4" cellspacing
="0">
118 <td
class="tabs" align
="center">
119  
;<a href
="http://www.amule.org" target
="_blank"><img src
="emule.gif"></a
>
120 <font face
="Tahoma" style
="font-size:13pt;" color
="#000000">aMule
<br
>Web Control Panel
</font
>
122 <td
class="tabs" align
="center" width
="30">  
; </td
>
124 <td align
="center" class="tabs" width
="95">
125 <a href
="servers.php">
126 <img src
="cp_servers.gif"><br
>
130 <td align
="center" class="tabs" width
="95">
131 <a href
="downloads.php">
132 <img src
="cp_download.gif"><br
>
137 <td align
="center" class="tabs" width
="95">
138 <a href
="search.php">
139 <img src
="cp_search.gif"><br
>
143 <td align
="center" class="tabs" width
="95">
145 <a href
="shared.php">
146 <img src
="cp_shared.gif"><br
>
149 <td align
="center" class="tabs" width
="110">
150 <a href
="stat_tree.php">
151 <img src
="cp_stats.gif"><br
>
153 <font color
="#000000">|
</font
>
155 <a href
="stat_graphs.php">Graphs
</a
>
158 <td align
="center" class="tabs" width
="95">
159 <a href
="preferences.php">
160 <img src
="cp_settings.gif"><br
>
165 <td
class="tabs" align
="center" width
="30"> 
;</td
>
166 <td align
="left" class="tabs" width
="95">
167 <img src
="log.gif"> <a href
="index.php?serverinfo=1">Serverinfo
</a
><br
>
168 <img src
="log.gif"> <a href
="index.php?log=1">Log
</a
>
176 <td style
="background-color: #000000; height: 1px" colspan
="2">
181  
; 
;<b
>Connection
:</b
>
183 function CastToXBytes($size)
185 if ( $size < 1024 ) {
186 $result = $size . " bytes";
187 } elseif ( $size < 1048576 ) {
188 $result = ($size / 1024.0) . "KB";
189 } elseif ( $size < 1073741824 ) {
190 $result = ($size / 1048576.0) . "MB";
192 $result = ($size / 1073741824.0) . "GB";
197 $stats = amule_get_stats();
198 if ( $stats["kad_connected"] == 1 ) {
200 if ( $stats["kad_firewalled"] == 1 ) {
201 echo " to KAD (firewalled), ";
206 echo "Not connected to KAD, ";
208 if ( $stats["id"] == 0 ) {
209 echo "not connected to ED2K";
210 } elseif ( $stats["id"] == 0xffffffff ) {
211 echo "connecting to ED2k";
213 echo "connected with ", (($stats["id"] < 16777216) ?
"low" : "high"), " ID to ",
214 $stats["serv_name"], " ", $stats["serv_addr"];
216 echo '<br> <b>Speed:</b> Up: ', CastToXBytes($stats["speed_up"]), 'ps',
217 ' | Down: ', CastToXBytes($stats["speed_down"]), 'ps',
218 '<small> (Limits: ', CastToXBytes($stats["speed_limit_up"]), 'ps/',
219 CastToXBytes($stats["speed_limit_down"]), 'ps)</small> ';
223 <script language
="javascript">
225 s
= "[ " + d
.getDate() +
"/" +
(d
.getMonth() +
1) +
"/" + d
.getFullYear() +
" " + d
.getHours() +
":" +
(d
.getMinutes() < 10 ?
"0" : "") + d
.getMinutes() +
":" +
(d
.getSeconds() < 10 ?
"0" : "") + d
.getSeconds() +
" ]";
230 <td align
=right
class=tabs
>
232 <input type
="button" value
="ed2k://Download" onClick
='self.location.href="index.php?links=1"'>
233 <input type
="button" value
="Logout" onClick
='self.location.href="login.php"'>
237 </table
><font face
=Tahoma style
="font-size:8pt;">
238 <table align
=center border
=0 cellpadding
=4 cellspacing
=0 width
="95%">
241 <td valign
=middle
class="shared-header-left"><a href
="shared.php?sort=name"><b
>File Name
</b
></a
></td
>
242 <td valign
=middle
class="shared-header">
243 <a href
="shared.php?sort=xfer"><b
>Transferred Data
</b
></a
> 
244 <a href
="shared.php?sort=allxfer">(Total
)
246 <td valign
=middle
class="shared-header">
247 <a href
="shared.php?sort=req"><b
>Requests
</b
></a
> 
248 <a href
="shared.php?sort=allreq"><b
>(Total
)</b
></a
> 
251 <td valign
=middle
class="shared-header">
252 <a href
="shared.php?sort=acc"><b
>Accepted Requests
</b
></a
> 
253 <a href
="shared.php?sort=allacc"><b
>(Total
)</b
></a
>
255 <td valign
=middle
class="shared-header"><a href
="shared.php?sort=size"><b
>Size
</b
></a
></td
>
256 <td valign
=middle
class="shared-header"><a href
="shared.php?sort=priority"><b
>Priority
</b
></a
></td
>
257 <td valign
=middle width
="10%" class="shared-header"><b
>ED2K
Link(s
)</b
></td
>
259 <p align
=center
><div
class="message"></div
></p
><br
>
263 function CastToXBytes($size)
265 if ( $size < 1024 ) {
266 $result = $size . " bytes";
267 } elseif ( $size < 1048576 ) {
268 $result = ($size / 1024.0) . "KB";
269 } elseif ( $size < 1073741824 ) {
270 $result = ($size / 1048576.0) . "MB";
272 $result = ($size / 1073741824.0) . "GB";
276 function PrioString($file)
278 $prionames = array(0 => "Low", 1 => "Normal", 2 => "High",
279 3 => "Very high", 4 => "Very low", 5=> "Auto", 6 => "Powershare");
280 $result = $prionames[$file->prio
];
281 if ( $file->prio_auto
== 1) {
282 $result = $result . "(auto)";
288 // declare it here, before any function reffered it in "global"
290 $sort_order;$sort_reverse;
292 function my_cmp($a, $b)
294 global $sort_order, $sort_reverse;
296 switch ( $sort_order) {
297 case "size": $result = $a->size
> $b->size
; break;
298 case "name": $result = $a->name
> $b->name
; break;
299 case "xfer": $result = $a->xfer
> $b->xfer
; break;
300 case "allxfer": $result = $a->xfer_all
> $b->xfer_all
; break;
301 case "acc": $result = $a->accept
> $b->accept
; break;
302 case "allacc": $result = $a->accept_all
> $b->accept_all
; break;
303 case "req": $result = $a->req
> $b->req
; break;
304 case "req_all": $result = $a->req_all
> $b->req_all
; break;
305 case "prio": $result = PrioString($a) > PrioString($b); break;
308 if ( $sort_reverse ) {
314 if (($HTTP_GET_VARS["cmd"] != "") && ($_SESSION["guest_login"] == 0)) {
315 if ($HTTP_GET_VARS["cmd"] == "reload") {
316 amule_do_reload_shared_cmd();
318 amule_do_shared_cmd($HTTP_GET_VARS["file"], $HTTP_GET_VARS["cmd"]);
322 $shared = amule_load_vars("shared");
324 $sort_order = $HTTP_GET_VARS["sort"];
326 if ( $sort_order == "" ) {
327 $sort_order = $_SESSION["shared_sort"];
329 if ( $_SESSION["sort_reverse"] == "" ) {
330 $_SESSION["sort_reverse"] = 0;
332 $_SESSION["sort_reverse"] = !$_SESSION["sort_reverse"];
336 $sort_reverse = $_SESSION["sort_reverse"];
337 if ( $sort_order != "" ) {
338 $_SESSION["shared_sort"] = $sort_order;
339 usort(&$shared, "my_cmp");
342 foreach ($shared as $file) {
344 echo '<td valign=top class="shared-line-left"><acronym title="', $file->name
, '">',
345 $file->name
, '</acronym></td>';
346 echo '<td valign=top class="shared-line">', CastToXBytes($file->xfer
),
347 '(', CastToXBytes($file->xfer_all
),')</td>';
349 echo '<td valign=top class="shared-line">' , $file->req
, '(', $file->req_all
,')</td>';
350 echo '<td valign=top class="shared-line">' , $file->accept
, '(', $file->accept_all
,')</td>';
351 echo '<td valign=top class="shared-line">', CastToXBytes($file->size
), '</td>';
352 echo '<td valign=top class="shared-line">', PrioString($file), '</td>';
353 echo '<td valign=top class="shared-line"><acronym title="ED2K Link(s)"><a href="',
354 $file->link
, '"><img src="l_ed2klink.gif" alt="ED2K Link(s)"></a></acronym>';
356 if ( $_SESSION["guest_login"] == 0 ) {
357 echo '<acronym title="Increase Priority"><a href="shared.php?cmd=prioup&file=', $file->hash
,
358 '"><img src="l_up.gif" alt="Increase Priority"></a></acronym>';
359 echo '<acronym title="Decrease Priority"><a href="shared.php?cmd=priodown&file=', $file->hash
,
360 '"><img src="l_down.gif" alt="Decrease Priority"></a></acronym>';
371 <form
><input type
="button" name
="queue" value
="Reload List" onClick
="self.location.href='shared.php?cmd=reload'"></form
>