1 <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <title
>amule download page
</title
>
6 <meta http
-equiv
="Content-Type" content
="text/html; charset=iso-8859-1">
7 <style type
="text/css">
14 background
-color
: #003399;
22 <table width
="100%" border
="1" bgcolor
="#0099CC">
24 <td height
="20"> 
;</td
>
27 <td
><table width
="100%" border
="0" align
="left" cellspacing
="1">
29 <th width
="33" scope
="col"></th
>
30 <th width
="172" ><div align
="left"><a href
="amuleweb-main-servers.php?sort=name" target
="mainFrame">Name
</a
></div
></th
>
31 <th width
="227" ><div align
="left">
32 <div align
="left"><a href
="amuleweb-main-servers.php?sort=desc" target
="mainFrame">Description
</a
></div
></th
>
33 <th width
="149" scope
="col"><div align
="left">
34 <div align
="left">Address
</div
></th
>
35 <th width
="77" scope
="col"><div align
="left"><a href
="amuleweb-main-servers.php?sort=users" target
="mainFrame">Users
</a
></div
></th
>
36 <th width
="80" scope
="col"><div align
="left"><a href
="amuleweb-main-servers.php?sort=maxusers" target
="mainFrame">Max Users
</a
> </div
></th
>
37 <th width
="37" scope
="col"><div align
="left"><a href
="amuleweb-main-servers.php?sort=files" target
="mainFrame">Files
</a
></div
></th
>
44 // declare it here, before any function reffered it in "global"
46 $sort_order;$sort_reverse;
48 function my_cmp($a, $b)
50 global $sort_order, $sort_reverse;
51 switch ( $sort_order) {
52 case "name": $result = $a->name
> $b->name
; break;
53 case "desc": $result = $a->desc
> $b->desc
; break;
54 case "users": $result = $a->users
> $b->users
; break;
55 case "max_users": $result = $a->maxusers
> $b->maxusers
; break;
56 case "files":$result = $a->files
> $b->files
; break;
59 if ( $sort_reverse ) {
65 $servers = amule_load_vars("servers");
67 $sort_order = $HTTP_GET_VARS["sort"];
70 // perform command before processing content
72 if ( ($HTTP_GET_VARS["cmd"] != "") and ($HTTP_GET_VARS["ip"] != "") and ($HTTP_GET_VARS["port"] != "")) {
73 if ($_SESSION["guest_login"] == 0) {
74 amule_do_server_cmd($HTTP_GET_VARS["ip"], $HTTP_GET_VARS["port"], $HTTP_GET_VARS["cmd"]);
78 if ( $sort_order == "" ) {
79 $sort_order = $_SESSION["servers_sort"];
81 if ( $_SESSION["sort_reverse"] == "" ) {
82 $_SESSION["sort_reverse"] = 0;
84 $_SESSION["sort_reverse"] = !$_SESSION["sort_reverse"];
88 $sort_reverse = $_SESSION["sort_reverse"];
89 if ( $sort_order != "" ) {
90 $_SESSION["servers_sort"] = $sort_order;
91 usort(&$servers, "my_cmp");
93 foreach ($servers as $srv) {
96 if ($_SESSION["guest_login"] != 0) {
100 '<a href="amuleweb-main-servers.php?cmd=connect&ip=', $srv->ip
,
101 '&port=', $srv->port
, '" target="mainFrame">',
102 '<img src="connect.gif" width="16" height="16" border="0">','</a>',
103 '<a href="amuleweb-main-servers.php?cmd=remove&ip=', $srv->ip
,
104 '&port=', $srv->port
, '" target="mainFrame">',
105 '<img src="cancel.gif" width="16" height="16" border="0">','</a>',
109 echo "<td>", $srv->name
, "</td>";
110 echo "<td>", $srv->desc
, "</td>";
111 echo "<td>", $srv->addr
, "</td>";
112 echo "<td>", $srv->users
, "</td>";
113 echo "<td>", $srv->maxusers
, "</td>";
114 echo "<td>", $srv->files
, "</td>";