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>";
9 <style type
="text/css">
14 a
, a
:active
, a
:link
, a
:visited
18 .down
-header
, .down
-header
-left
, .down
-header
-right
,
19 .down
-line
, .down
-line
-good
, .down
-line
-left
, .down
-line
-good
-left
,
20 .down
-line
-right
, .down
-line
-good
-right
,
21 .up
-header
, .up
-header
-left
, .up
-line
, .up
-line
-left
,
22 .server
-header
, .server
-header
-left
, .server
-line
, .server
-line
-left
,
23 .shared
-header
, .shared
-header
-left
, .shared
-line
, .shared
-line
-changed
,
24 .shared
-line
-left
, .shared
-line
-left
-changed
,
25 .header
, .smallheader
, .commontext
,
26 .upqueue
-header
, .upqueue
-line
, .upqueue
-line
-left
,
27 .websearch
-header
, .websearch
-line
, .addserver
-header
, .addserver
-line
36 background
-color
: #3399FF;
38 .down
-header
, .down
-line
, .down
-line
-good
, .up
-header
, .up
-line
,
39 .server
-header
, .server
-line
, .shared
-header
, .shared
-line
, .shared
-line
-changed
,
40 .upqueue
-header
, .upqueue
-line
,
41 .websearch
-header
, .websearch
-line
, .addserver
-header
, .addserver
-line
45 .down
-header
-left
, .down
-line
-left
, .down
-line
-good
-left
,
46 .server
-header
-left
, .server
-line
-left
, .shared
-header
-left
,
47 .up
-header
-left
, .up
-line
-left
, .shared
-line
-left
, .shared
-line
-left
-changed
, .upqueue
-line
-left
51 .down
-line
-right
, .down
-line
-good
-right
, .down
-header
-right
55 .down
-header
, .down
-header
-left
, .down
-header
-right
,
56 .up
-header
, .up
-header
-left
, .server
-header
, .server
-header
-left
,
57 .shared
-header
, .shared
-header
-left
, .upqueue
-header
,
58 .websearch
-header
, .addserver
-header
60 background
-color
: #0066CC;
64 background
-color
: #0046AC;
68 background
-color
: #003399;
73 background
-color
: #FFFFFF;
76 .down
-line
, .down
-line
-good
, .down
-line
-left
, .down
-line
-good
-left
,
77 .down
-line
-right
, .down
-line
-good
-right
,
78 .up
-line
, .up
-line
-left
, .server
-line
, .server
-line
-left
,
79 .shared
-line
, .shared
-line
-changed
, .shared
-line
-left
, .shared
-line
-left
-changed
,
80 .upqueue
-line
, .upqueue
-line
-left
,
81 .websearch
-line
, .addserver
-line
83 background
-color
: #3399FF;
85 .down
-line
-good
, .down
-line
-good
-left
, .down
-line
-good
-right
, .shared
-line
-changed
, .shared
-line
-left
-changed
91 border
:0px solid
#000000;
92 border
-collapse
: collapse
;
107 <body bgcolor
="#FBDE9C" text
=white link
="#3399FF" vlink
="#3399FF" alink
="#3399FF" marginwidth
=0 marginheight
=0 topmargin
=0 leftmargin
=0 style
="margin:0px">
108 <table border
=0 width
="100%" align
=center cellpadding
=4 cellspacing
=0>
110 <td
class="tabs" align
="left" colspan
="2">
112 <table border
="0" cellpadding
="4" cellspacing
="0">
114 <td
class="tabs" align
="center">
115  
;<a href
="http://www.amule.org" target
="_blank"><img src
="emule.gif"></a
>
116 <font face
="Tahoma" style
="font-size:13pt;" color
="#000000">aMule
<br
>Web Control Panel
</font
>
118 <td
class="tabs" align
="center" width
="30"> 
; </td
>
120 <td align
="center" class="tabs" width
="95">
121 <a href
="servers.php">
122 <img src
="cp_servers.gif"><br
>
126 <td align
="center" class="tabs" width
="95">
127 <a href
="downloads.php">
128 <img src
="cp_download.gif"><br
>
133 <td align
="center" class="tabs" width
="95">
134 <a href
="search.php">
135 <img src
="cp_search.gif"><br
>
139 <td align
="center" class="tabs" width
="95">
141 <a href
="shared.php">
142 <img src
="cp_shared.gif"><br
>
145 <td align
="center" class="tabs" width
="110">
146 <a href
="stat_tree.php">
147 <img src
="cp_stats.gif"><br
>
149 <font color
="#000000">|
</font
>
151 <a href
="stat_graphs.php">Graphs
</a
>
154 <td align
="center" class="tabs" width
="95">
155 <a href
="preferences.php">
156 <img src
="cp_settings.gif"><br
>
161 <td
class="tabs" align
="center" width
="30"> 
;</td
>
162 <td align
="left" class="tabs" width
="95">
163 <img src
="log.gif"> <a href
="index.php?serverinfo=1">Serverinfo
</a
><br
>
164 <img src
="log.gif"> <a href
="index.php?log=1">Log
</a
>
172 <td style
="background-color: #000000; height: 1px" colspan
="2">
177  
; 
;<b
>Connection
:</b
>
179 function CastToXBytes($size)
181 if ( $size < 1024 ) {
182 $result = $size . " bytes";
183 } elseif ( $size < 1048576 ) {
184 $result = ($size / 1024.0) . "KB";
185 } elseif ( $size < 1073741824 ) {
186 $result = ($size / 1048576.0) . "MB";
188 $result = ($size / 1073741824.0) . "GB";
193 $stats = amule_get_stats();
194 if ( $stats["kad_connected"] == 1 ) {
196 if ( $stats["kad_firewalled"] == 1 ) {
197 echo " to KAD (firewalled), ";
202 echo "Not connected to KAD, ";
204 if ( $stats["id"] == 0 ) {
205 echo "not connected to ED2K";
206 } elseif ( $stats["id"] == 0xffffffff ) {
207 echo "connecting to ED2k";
209 echo "connected with ", (($stats["id"] < 16777216) ?
"low" : "high"), " ID to ",
210 $stats["serv_name"], " ", $stats["serv_addr"];
212 echo '<br> <b>Speed:</b> Up: ', CastToXBytes($stats["speed_up"]), 'ps',
213 ' | Down: ', CastToXBytes($stats["speed_down"]), 'ps',
214 '<small> (Limits: ', CastToXBytes($stats["speed_limit_up"]), 'ps/',
215 CastToXBytes($stats["speed_limit_down"]), 'ps)</small> ';
220 <script type
="text/javascript" language
="javascript">
222 s
= "[ " + d
.getDate() +
"/" +
(d
.getMonth() +
1) +
"/" + d
.getFullYear() +
" " + d
.getHours() +
":" +
(d
.getMinutes() < 10 ?
"0" : "") + d
.getMinutes() +
":" +
(d
.getSeconds() < 10 ?
"0" : "") + d
.getSeconds() +
" ]";
227 <td align
=right
class=tabs
>
229 <input type
="button" value
="ed2k://Download" onClick
='self.location.href="index.php?links=1"'>
230 <input type
="button" value
="Logout" onClick
='self.location.href="login.php"'>
237 <p align
=center
><div
class="message"></div
></p
><br
>
239 <table border
=0 align
=center cellpadding
=4 cellspacing
=0 width
="85%">
241 <td valign
=middle
class="websearch-header"><b
><font face
=Tahoma style
="font-size:10pt;">Search Results
</font
></b
> 
; 
;(<a align
="right" href
="javascript:self.location.href='search.php'"><font face
=Tahoma style
="font-size:8pt;">Refetch Results
</font
></a
>)</td
>
245 <td valign
=middle
class="websearch-line">
247 <form action
="" method
="GET">
248 <table border
=0 align
=center cellpadding
=4 cellspacing
=0>
249 <input type
="hidden" name
=cmd value
="download">
251 <td
class="websearch-line"><b
><font face
=Tahoma style
="font-size:8pt;"><a href
="search.php?sort=name">File Name
</a
></font
></b
></td
>
252 <td
class="websearch-line" width
=50><b
><font face
=Tahoma style
="font-size:8pt;"><a href
="search.php?sort=size">Size
</a
></font
></b
></td
>
253 <td
class="websearch-line"><b
><font face
=Tahoma style
="font-size:8pt;"><a href
="search.php?sort=sources">Sources
</a
></b
></td
>
254 <td
class="websearch-line" width
=100><b
><font face
=Tahoma style
="font-size:8pt;">Download
</font
></b
></td
>
258 function CastToXBytes($size)
260 if ( $size < 1024 ) {
261 $result = $size . " bytes";
262 } elseif ( $size < 1048576 ) {
263 $result = ($size / 1024.0) . "KB";
264 } elseif ( $size < 1073741824 ) {
265 $result = ($size / 1048576.0) . "MB";
267 $result = ($size / 1073741824.0) . "GB";
271 function cat2idx($cat)
273 $cats = amule_get_categories();
275 foreach($cats as $i => $c) {
276 if ( $cat == $c) $result = $i;
282 // declare it here, before any function reffered it in "global"
284 $sort_order;$sort_reverse;
286 function my_cmp($a, $b)
288 global $sort_order, $sort_reverse;
290 switch ( $sort_order) {
291 case "size": $result = $a->size
> $b->size
; break;
292 case "name": $result = $a->name
> $b->name
; break;
293 case "sources": $result = $a->sources
> $b->sources
; break;
296 if ( $sort_reverse ) {
303 if ($_SESSION["guest_login"] == 0) {
304 if ( $HTTP_GET_VARS["cmd"] == "search") {
307 switch($HTTP_GET_VARS["method"]) {
308 case "server": $search_type = 0; break;
309 case "global": $search_type = 1; break;
310 case "kad": $search_type = 2; break;
313 $min_size = $HTTP_GET_VARS["min"] == "" ?
0 : $HTTP_GET_VARS["min"];
314 $max_size = $HTTP_GET_VARS["max"] == "" ?
0 : $HTTP_GET_VARS["max"];
316 $min_size *= 1024*1024;
317 $max_size *= 1024*1024;
319 amule_do_search_start_cmd($HTTP_GET_VARS["tosearch"],
320 $HTTP_GET_VARS["ext"], $HTTP_GET_VARS["type"],
321 $search_type, $HTTP_GET_VARS["avail"], $min_size, $max_size);
322 } elseif ( $HTTP_GET_VARS["cmd"] == "download") {
323 foreach ( $HTTP_GET_VARS as $name => $val) {
324 // this is file checkboxes
325 if ( (strlen($name) == 32) and ($val == "on") ) {
326 $cat = $HTTP_GET_VARS["cat"];
327 $cat_idx = cat2idx($cat);
328 amule_do_search_download_cmd($name, $cat_idx);
332 // wrong command come
333 //var_dump($HTTP_GET_VARS);
337 $search = amule_load_vars("searchresult");
339 $sort_order = $HTTP_GET_VARS["sort"];
341 if ( $sort_order == "" ) {
342 $sort_order = $_SESSION["search_sort"];
344 if ( $_SESSION["search_sort_reverse"] == "" ) {
345 $_SESSION["search_sort_reverse"] = 0;
347 $_SESSION["search_sort_reverse"] = !$_SESSION["search_sort_reverse"];
351 $sort_reverse = $_SESSION["search_sort_reverse"];
352 if ( $sort_order != "" ) {
353 $_SESSION["search_sort"] = $sort_order;
354 usort(&$search, "my_cmp");
357 foreach ($search as $file) {
358 echo '<tr><td align="left"><font face=Tahoma style="font-size:8pt;">', $file->name
,
359 '</font></td><td class="websearch-line"><font face=Tahoma style="font-size:8pt;">', CastToXBytes($file->size
),
360 '</font></td><td class="websearch-line"><font face=Tahoma style="font-size:8pt;">', $file->sources
,
361 '</font></td><td class="websearch-line"><input type="checkbox" name="', $file->hash
,
369 <input type
="submit" value
="Download">
370 <img src
="arrow_right.gif" align
="absmiddle">
372 <select name
="cat" size
="1">
374 $cats = amule_get_categories();
375 foreach($cats as $c) {
376 echo "<option>", $c, "</option>";
389 <form action
="" method
="GET">
390 <table border
=0 align
=center cellpadding
=4 cellspacing
=0 width
="250">
392 <td valign
=middle
class="websearch-header"><b
><font face
=Tahoma style
="font-size:10pt;">Search
</font
></b
></td
>
395 <td valign
=middle
class="websearch-line">
397 <tr
><td
class=tabs width
=150>Name
</td
><td
><input name
="tosearch" type
="text" size
="40"></td
></tr
>
398 <tr
><td
class=tabs
>Type
</td
>
401 <option value
=""></option
>
402 <option value
="Archives">Archive
</option
>
403 <option value
="Audio">Audio
</option
>
404 <option value
="CD-Images">CD
-Images
</option
>
405 <option value
="Pictures">Pictures
</option
>
406 <option value
="Programs">Programs
</option
>
407 <option value
="Texts">Texts
</option
>
408 <option value
="Videos">Video
</option
>
411 <tr
><td
class=tabs
>Min
Size (MB
)</td
><td
><input name
="min" type
="text" size
="10"></td
></tr
>
412 <tr
><td
class=tabs
>Max
Size (MB
)</td
><td
><input name
="max" type
="text" size
="10"></td
></tr
>
413 <tr
><td
class=tabs
>Min Availability
</td
><td
><input name
="avail" type
="text" size
="10"></td
></tr
>
414 <tr
><td
class=tabs
>Extension
</td
><td
><input name
="ext" type
="text" size
="10"></td
></tr
>
415 <tr
><td
class=tabs
>Method
</td
><td
><input value
="server" type
="radio" name
="method" checked
>Server
</td
></tr
>
416 <tr
><td
class=tabs
></td
><td
><input value
="global" type
="radio" name
="method">Global Search
</td
></tr
>
417 <tr
><td
class=tabs
></td
><td
><input value
="kad" type
="radio" name
="method">Kad Search
</td
></tr
>
420 <input type
="hidden" name
=cmd value
="search">
421 <input type
="submit" value
="Search">