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>";
10 <style type
="text/css">
15 a
, a
:link
, a
:visited
{
17 text
-decoration
: none
;
22 text
-decoration
: none
;
25 .down
-header
, .down
-header
-left
, .down
-header
-right
,
26 .down
-line
, .down
-line
-good
, .down
-line
-left
, .down
-line
-good
-left
,
27 .down
-line
-right
, .down
-line
-good
-right
,
28 .up
-header
, .up
-header
-left
, .up
-line
, .up
-line
-left
,
29 .server
-header
, .server
-header
-left
, .server
-line
, .server
-line
-left
,
30 .shared
-header
, .shared
-header
-left
, .shared
-line
, .shared
-line
-changed
,
31 .shared
-line
-left
, .shared
-line
-left
-changed
,
32 .header
, .smallheader
, .commontext
,
33 .upqueue
-header
, .upqueue
-line
, .upqueue
-line
-left
,
34 .websearch
-header
, .websearch
-line
, .addserver
-header
, .addserver
-line
{
43 background
-color
: #1F76A5;
49 background
-color
: #0075B3;
60 background
-color
: #21719B;
66 background
-color
: #1D6083;
69 .down
-header
, .down
-line
, .down
-line
-good
, .up
-header
, .up
-line
,
70 .server
-header
, .server
-line
, .shared
-header
, .shared
-line
, .shared
-line
-changed
,
71 .upqueue
-header
, .upqueue
-line
,
72 .websearch
-header
, .websearch
-line
, .addserver
-header
, .addserver
-line
{
77 .down
-header
-left
, .down
-line
-left
, .down
-line
-good
-left
,
78 .server
-header
-left
, .server
-line
-left
, .shared
-header
-left
,
79 .up
-header
-left
, .up
-line
-left
, .shared
-line
-left
, .shared
-line
-left
-changed
, .upqueue
-line
-left
{
84 .down
-line
-right
, .down
-line
-good
-right
, .down
-header
-right
{
88 .down
-header
, .down
-header
-left
, .down
-header
-right
,
89 .up
-header
, .up
-header
-left
, .server
-header
, .server
-header
-left
,
90 .shared
-header
, .shared
-header
-left
, .upqueue
-header
,
91 .websearch
-header
, .addserver
-header
{
93 background
-color
: #1D6083;
97 background
-color
: #0046AC;
101 background
-color
: #003399;
106 background
-color
: #FFFFFF;
112 font
-family
: Tahoma
;
116 .down
-line
, .down
-line
-good
, .down
-line
-left
, .down
-line
-good
-left
,
117 .down
-line
-right
, .down
-line
-good
-right
,
118 .up
-line
, .up
-line
-left
, .server
-line
, .server
-line
-left
,
119 .shared
-line
, .shared
-line
-changed
, .shared
-line
-left
, .shared
-line
-left
-changed
,
120 .upqueue
-line
, .upqueue
-line
-left
,
121 .websearch
-line
, .addserver
-line
{
123 background
-color
: #1F76A5;
126 .down
-line
-good
, .down
-line
-good
-left
, .down
-line
-good
-right
,
127 .shared
-line
-changed
, .shared
-line
-left
-changed
{
133 border
:0px solid
#000000;
134 border
-collapse
: collapse
;
138 font
-family
: Tahoma
;
142 background
-color
: #1D6083;
151 <script language
="JavaScript" type
="text/JavaScript">
153 var initvals
= new Object;
156 // apply new options before proceeding
157 //var_dump($HTTP_GET_VARS);
158 if ( ($HTTP_GET_VARS["cmd"] == "apply") && ($_SESSION["guest_login"] == 0) ) {
160 "upload_full_chunks", "first_last_chunks_prio"
162 $conn_opts = array("max_line_up_cap","max_up_limit",
163 "max_line_down_cap","max_down_limit",
164 "max_file_src","max_conn_total");
165 $webserver_opts = array("use_gzip", "autorefresh_time");
168 foreach ($conn_opts as $i) {
169 $curr_value = $HTTP_GET_VARS[$i];
170 if ( $curr_value == "on") $curr_value = 1;
171 if ( $curr_value == "") $curr_value = 0;
173 $all_opts["connection"][$i] = $curr_value;
175 foreach ($file_opts as $i) {
176 $curr_value = $HTTP_GET_VARS[$i];
177 if ( $curr_value == "on") $curr_value = 1;
178 if ( $curr_value == "") $curr_value = 0;
180 $all_opts["files"][$i] = $curr_value;
182 foreach ($webserver_opts as $i) {
183 $curr_value = $HTTP_GET_VARS[$i];
184 if ( $curr_value == "on") $curr_value = 1;
185 if ( $curr_value == "") $curr_value = 0;
187 $all_opts["webserver"][$i] = $curr_value;
189 //var_dump($all_opts);
190 amule_set_options($all_opts);
193 $opts = amule_get_options();
195 $opt_groups = array("connection", "files", "webserver", "coretweaks");
196 //var_dump($opt_groups);
197 foreach ($opt_groups as $group) {
198 $curr_opts = $opts[$group];
199 //var_dump($curr_opts);
200 foreach ($curr_opts as $opt_name => $opt_val) {
201 echo 'initvals["', $opt_name, '"] = "', $opt_val, '";', "\n";
208 var frm
= document
.forms
.mainform
210 var str_param_names
= new Array(
211 "max_line_down_cap", "max_line_up_cap",
212 "max_up_limit", "max_down_limit", "max_file_src",
216 for(i
= 0; i
< str_param_names
.length
; i++
) {
217 frm
[str_param_names
[i
]].value
= initvals
[str_param_names
[i
]];
219 var check_param_names
= new Array(
220 "use_gzip", "upload_full_chunks", "first_last_chunks_prio"
222 for(i
= 0; i
< check_param_names
.length
; i++
) {
223 frm
[check_param_names
[i
]].checked
= initvals
[check_param_names
[i
]] == "1" ?
true : false;
231 <body onload
="init_data();" background
="main_bg.gif" text
=white link
="#1F76A5" vlink
="#1F76A5" alink
="#1F76A5" marginwidth
=0 marginheight
=0 topmargin
=0 leftmargin
=0 style
="margin:0px">
232 <table border
="0" width
="100%" align
="center" cellpadding
="0" cellspacing
="0">
234 <td
class="tabs_three" background
="main_top_bg.gif" align
="left" colspan
="4">
236 <table border
="0" cellpadding
="4" cellspacing
="0" width
="100%">
238 <td
class="tabs_three" align
="center" width
="100">
241 <font face
="Tahoma" style
="font-size:13pt;" color
="#000000"><a href
="http://www.amule.org" target
="_blank">
242 <img src
="emule.gif" alt
="aMule | Web Control Panel">
245 <td
class="tabs_three" align
="center" width
="30">
248 <td align
="center" class="tabs_three" width
="95">
250 <a href
="servers.php">
251 <img src
="cp_servers.gif"><br
/>
255 <td align
="center" class="tabs_three" width
="96">
256 <a href
="downloads.php">
257 <img src
="cp_download.gif"><br
/>
262 <td align
="center" class="tabs_three" width
="96">
263 <a href
="search.php">
264 <img src
="cp_search.gif"><br
/>
268 <td align
="center" class="tabs_three" width
="96">
269 <a href
="shared.php">
271 <img src
="cp_shared.gif"><br
/>
274 <td align
="center" class="tabs_three" width
="110">
275 <a href
="stat_tree.php">
276 <img src
="cp_stats.gif"><br
/>
279 <font color
="#000000">|
</font
>
281 <a href
="stat_graphs.php">
285 <td align
="center" class="tabs_three" width
="95">
286 <a href
="preferences.php">
287 <img src
="cp_settings.gif"><br
/>
292 <td
class="tabs_three" align
="center">
295 <td align
="left" class="tabs_three" width
="95">
296 <img src
="log.gif" align
="absmiddle"> <a href
="index.php?serverinfo=1">Serverinfo
</a
><br
/>
297 <img src
="log.gif" align
="absmiddle"> <a href
="index.php?log=1">Log
</a
>
306 <td background
="main_topbar.gif" height
="49" class="tabs_four">
307  
; 
;<b
>Connection
:</b
>
309 function CastToXBytes($size)
311 if ( $size < 1024 ) {
312 $result = $size . " bytes";
313 } elseif ( $size < 1048576 ) {
314 $result = ($size / 1024.0) . "KB";
315 } elseif ( $size < 1073741824 ) {
316 $result = ($size / 1048576.0) . "MB";
318 $result = ($size / 1073741824.0) . "GB";
323 $stats = amule_get_stats();
324 if ( $stats["id"] == 0 ) {
325 echo "Not connected";
326 } elseif ( $stats["id"] == 0xffffffff ) {
327 echo "Connecting ...";
329 echo "Connected with ", (($stats["id"] < 16777216) ?
"low" : "high"), " ID to ",
330 $stats["serv_name"], " ", $stats["serv_addr"];
332 echo '<br> <b>Speed:</b> Up: ', CastToXBytes($stats["speed_up"]), 'ps',
333 ' | Down: ', CastToXBytes($stats["speed_down"]), 'ps',
334 '<small> (Limits: ', CastToXBytes($stats["speed_limit_up"]), 'ps/',
335 CastToXBytes($stats["speed_limit_down"]), 'ps)</small> ';
337 <font color
="#FFE471">
338 <script language
="javascript">
340 s
= "[ " + d
.getDate() +
"/" +
(d
.getMonth() +
1) +
"/" + d
.getFullYear() +
" " + d
.getHours() +
":" +
(d
.getMinutes() < 10 ?
"0" : "") + d
.getMinutes() +
":" +
(d
.getSeconds() < 10 ?
"0" : "") + d
.getSeconds() +
" ]";
345 <td background
="main_topbar.gif" align
="center" valign
="middle" class="tabs_four">
347 <a href
="index.php?links=1">
348 <img src
="arrow_right.gif" align
="absmiddle">
349  
; ed2k
:// ED2K Link(s)
352 <td background
="main_topbar.gif" align
="right">
354 <table border
="0" cellpadding
="0" cellspacing
="0" width
="8" height
="100%">
356 <td height
="49" background
="main_topbarseperator.gif">
364 <td background
="main_topbardarker.gif" align
="center" valign
="middle" class="tabs_five">
366 <img src
="arrow_down_logout.gif" align
="absmiddle">
375 <form name
="mainform" action
="preferences.php" method
="post">
377 <input type
="hidden" name
="cmd" value
="apply">
378 <table border
=0 align
=center cellpadding
=4 cellspacing
=0 width
="90%">
379 <tr
><td
><font face
=Tahoma style
="font-size:10pt;" color
=black
>Web Control Panel
</font
></td
></tr
>
381 <td align
=left valign
=middle bgcolor
="#0066CC">
382 <font face
=Tahoma style
="font-size:8pt;"><b
>Gzip Compression
</b
></font
>
383 <input type
="checkbox" name
="use_gzip" id
="use_gzip">
387 <td align
=left valign
=top bgcolor
="#3399FF">
388 <font face
=Tahoma style
="font-size:8pt;">
389  
; 
; 
; 
;Save traffic
, especially in graphs
.
396 <td align
=left valign
=middle bgcolor
="#0066CC">
397 <font face
=Tahoma style
="font-size:8pt;"><b
>Refresh
-Time of Pages
</b
></font
>
401 <td align
=left valign
=top bgcolor
="#3399FF">
402 <font face
=Tahoma style
="font-size:8pt;">
403  
; 
; 
; 
;Time in
seconds (zero
=disabled
): <input type
="text" name
="autorefresh_time" id
="autorefresh_time" size
="5" class=dinput
><br
>
409 <tr
><td
><br
><font face
=Tahoma style
="font-size:10pt;" color
=black
>aMule
</font
></td
></tr
>
411 <td align
=left valign
=middle bgcolor
="#0066CC">
412 <font face
=Tahoma style
="font-size:8pt;"><b
>Speed Limits
</b
></font
>
417 <td align
=left valign
=top bgcolor
="#3399FF">
418 <font face
=Tahoma style
="font-size:8pt;">
419  
; 
; 
; 
;Download
: <input type
="text" name
="max_down_limit" id
="max_down_limit" size
="5" class=dinput
> kB
/s
420  
; 
;Upload
: <input type
="text" name
="max_up_limit" id
="max_up_limit" size
="5" class=dinput
> kB
/s
426 <td align
=left valign
=middle bgcolor
="#0066CC">
427 <font face
=Tahoma style
="font-size:8pt;"><b
>Bandwidth Limits
</b
></font
>
432 <td align
=left valign
=top bgcolor
="#3399FF">
433 <font face
=Tahoma style
="font-size:8pt;">
434  
; 
; 
; 
;Download
: <input type
="text" name
="max_line_down_cap" id
="max_line_down_cap" size
="5" class=dinput
> kB
/s
435  
; 
;Upload
: <input type
="text" name
="max_line_up_cap" id
="max_line_up_cap" size
="5" class=dinput
> kB
/s
441 <td align
=left valign
=middle bgcolor
="#0066CC">
442 <font face
=Tahoma style
="font-size:8pt;"><b
>Connection Limits
</b
></font
>
447 <td align
=left valign
=top bgcolor
="#3399FF">
449 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Max Sources Per File
:</font
></td
><td
>
450 <input type
="text" name
="max_file_src" id
="max_file_src" size
="5" class=dinput value
="300"></td
></tr
>
451 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Max
. Connections
:</font
></td
><td
>
452 <input type
="text" name
="max_conn_total" id
="max_conn_total" size
="5" class=dinput value
="499"></td
></tr
>
453 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Max
. new connections
/ 5secs
:</font
></td
><td
>
454 <input type
="text" name
="max_conn_5sec" id
="max_conn_5sec" size
="5" class=dinput value
="20"></td
></tr
>
460 <td align
=left valign
=middle bgcolor
="#0066CC">
462 <font face
=Tahoma style
="font-size:8pt;"><b
>File Settings
</b
></font
>
466 <td align
=left valign
=top bgcolor
="#3399FF">
468 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Try to transfer full chunks to all uploads
</font
></td
><td
>
469 <input type
="checkbox" name
="upload_full_chunks" id
="upload_full_chunks"></td
></tr
>
470 <tr
><td
><font face
=Tahoma style
="font-size:8pt;">Try to download first
and last chunks first
</font
></td
><td
>
471 <input type
="checkbox" name
="first_last_chunks_prio" id
="first_last_chunks_prio"></td
></tr
>
477 <td align
=center
><br
><input type
=submit value
="Apply"></td
>