📄 amuleweb-main-dload.php
字号:
<th><a href="amuleweb-main-dload.php?sort=size">Size</a></th> <th><a href="amuleweb-main-dload.php?sort=size_done">Completed</a></th> <th><a href="amuleweb-main-dload.php?sort=speed">Download speed</a></th> <th><a href="amuleweb-main-dload.php?sort=progress">Progress</a></th> <th><a href="amuleweb-main-dload.php?sort=srccount">Sources</a></th> <th><a href="amuleweb-main-dload.php?sort=status">Status</a></th> <th><a href="amuleweb-main-dload.php?sort=prio">Priority</a></th> </tr><tr><td colspan="9" height="1" bgcolor="#000000"></td></tr> <?php function CastToXBytes($size) { if ( $size < 1024 ) { $result = $size . " b"; } elseif ( $size < 1048576 ) { $result = ($size / 1024.0) . " kb"; } elseif ( $size < 1073741824 ) { $result = ($size / 1048576.0) . " mb"; } else { $result = ($size / 1073741824.0) . " gb"; } return $result; } function StatusString($file) { if ( $file->status == 7 ) { return "Paused"; } elseif ( $file->src_count_xfer > 0 ) { return "Downloading"; } else { return "Waiting"; } } function PrioString($file) { $prionames = array(0 => "Low", 1 => "Normal", 2 => "High", 3 => "Very high", 4 => "Very low", 5=> "Auto", 6 => "Release"); $result = $prionames[$file->prio]; if ( $file->prio_auto == 1) { $result = $result . "(auto)"; } return $result; } // // declare it here, before any function reffered it in "global" // $sort_order;$sort_reverse; function my_cmp($a, $b) { global $sort_order, $sort_reverse; switch ( $sort_order) { case "size": $result = $a->size > $b->size; break; case "size_done": $result = $a->size_done > $b->size_done; break; case "progress": $result = (((float)$a->size_done)/((float)$a->size)) > (((float)$b->size_done)/((float)$b->size)); break; case "name": $result = $a->name > $b->name; break; case "speed": $result = $a->speed > $b->speed; break; case "scrcount": $result = $a->src_count > $b->src_count; break; case "status": $result = StatusString($a) > StatusString($b); break; case "prio": $result = PrioString($a) > PrioString($b); break; } if ( $sort_reverse ) { $result = !$result; } //var_dump($sort_reverse); return $result; } // // perform command b20efore processing content if ( ($HTTP_GET_VARS["command"] != "") && ($_SESSION["guest_login"] == 0) ) { foreach ( $HTTP_GET_VARS as $name => $val) { // this is file checkboxes if ( (strlen($name) == 32) and ($val == "on") ) { //var_dump($name); amule_do_download_cmd($name, $HTTP_GET_VARS["command"]); } } // // check "filter-by-status" settings // if ( $HTTP_GET_VARS["command"] == "filter") { //var_dump($_SESSION); $_SESSION["filter_status"] = $HTTP_GET_VARS["status"]; $_SESSION["filter_cat"] = $HTTP_GET_VARS["category"]; } } if ( $_SESSION["filter_status"] == "") $_SESSION["filter_status"] = "all"; if ( $_SESSION["filter_cat"] == "") $_SESSION["filter_cat"] = "all"; $downloads = amule_load_vars("downloads"); $sort_order = $HTTP_GET_VARS["sort"]; if ( $sort_order == "" ) { $sort_order = $_SESSION["download_sort"]; } else { if ( $_SESSION["download_sort_reverse"] == "" ) { $_SESSION["download_sort_reverse"] = 0; } else { if ( $HTTP_GET_VARS["sort"] != '') { $_SESSION["download_sort_reverse"] = !$_SESSION["download_sort_reverse"]; } } } //var_dump($_SESSION); $sort_reverse = $_SESSION["download_sort_reverse"]; if ( $sort_order != "" ) { $_SESSION["download_sort"] = $sort_order; usort(&$downloads, "my_cmp"); } // // Prepare categories index array $cats = amule_get_categories(); foreach($cats as $i => $c) { $cat_idx[$c] = $i; } foreach ($downloads as $file) { $filter_status_result = ($_SESSION["filter_status"] == "all") or ($_SESSION["filter_status"] == StatusString($file)); $filter_cat_result = ($_SESSION["filter_cat"] == "all") or ($cat_idx[ $_SESSION["filter_cat"] ] == $file->category); if ( $filter_status_result and $filter_cat_result) { print "<tr>"; echo "<td class='texte' height='22'>", '<input type="checkbox" name="', $file->hash, '" >', "</td>"; echo "<td class='texte' height='22'>", $file->short_name, "</td>"; echo "<td class='texte' height='22' align='center'>", CastToXBytes($file->size), "</td>"; echo "<td class='texte' height='22' align='center'>", CastToXBytes($file->size_done), " (", ((float)$file->size_done*100)/((float)$file->size), "%)</td>"; echo "<td class='texte' height='22' align='center'>", ($file->speed > 0) ? (CastToXBytes($file->speed) . "/s") : "-", "</td>"; echo "<td class='texte' height='22' align='center' align='center'>", $file->progress, "</td>"; echo "<td class='texte' height='22' align='center'>"; if ( $file->src_count_not_curr != 0 ) { echo $file->src_count - $file->src_count_not_curr, " / "; } echo $file->src_count, " ( ", $file->src_count_xfer, " ) "; if ( $file->src_count_a4af != 0 ) { echo "+ ", $file->src_count_a4af; } echo "</td>"; echo "<td class='texte' height='22' align='center'>", StatusString($file), "</td>"; echo "<td class='texte' height='22' align='center'>", PrioString($file), "</td>"; print "</tr><tr><td colspan='9' height='1' bgcolor='#c0c0c0'></td></tr>"; } } ?> </table></td> <td width="24" background="images/tab_right.png"> </td> </tr> <tr> <td width="24"><img src="images/tab_bottom_left.png" width="24" height="24"></td> <td background="images/tab_bottom.png"> </td> <td width="24"><img src="images/tab_bottom_right.png" width="24" height="24"></td> </tr></table></td> </tr> </table></form> <table width="100%" border="0" cellspacing="0" cellpadding="0"><caption> UPLOAD </caption> <tr> <td width="24"><img src="images/tab_top_left.png" width="24" height="24"></td> <td background="images/tab_top.png"> </td> <td width="24"><img src="images/tab_top_right.png" width="24" height="24"></td> </tr> <tr> <td width="24" background="images/tab_left.png"> </td> <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="doad-table"> <tr> <td> </td> <th>File Name</th> <th>Username</th> <th>Up</th> <th>Down</th> <th> </th> <th> </th> <th>Speed</th> <td> </td> </tr><tr><td colspan="9" height="1" bgcolor="#000000"></td></tr> <?php function CastToXBytes($size) { if ( $size < 1024 ) { $result = $size . " b"; } elseif ( $size < 1048576 ) { $result = ($size / 1024.0) . " kb"; } elseif ( $size < 1073741824 ) { $result = ($size / 1048576.0) . " mb"; } else { $result = ($size / 1073741824.0) . " gb"; } return $result; } $uploads = amule_load_vars("uploads"); foreach ($uploads as $file) { echo "<tr>"; echo "<td class='texte' height='22' align='center'>", "</td>"; echo "<td class='texte' height='22'>", $file->short_name, "</td>"; echo "<td class='texte' height='22' align='center'>", $file->user_name, "</td>"; echo "<td class='texte' height='22' align='center'>", CastToXBytes($file->xfer_up), "</td>"; echo "<td class='texte' height='22' align='center'>", CastToXBytes($file->xfer_down), "</td>"; echo "<td class='texte' height='22' align='center'>", "</td>"; echo "<td class='texte' height='22' align='center'>", "</td>"; echo "<td class='texte' height='22' align='center'>", ($file->xfer_speed > 0) ? (CastToXBytes($file->xfer_speed) . "/s") : "-", "</td>"; echo "<td class='texte' height='22' align='center'>", "</td>"; echo "</tr><tr><td colspan='9' height='1' bgcolor='#c0c0c0'></td></tr>"; } ?> </table></td> <td width="24" background="images/tab_right.png"> </td> </tr> <tr> <td width="24"><img src="images/tab_bottom_left.png" width="24" height="24"></td> <td background="images/tab_bottom.png"> </td> <td width="24"><img src="images/tab_bottom_right.png" width="24" height="24"></td> </tr> </table> </td> </tr> <tr valign="bottom"> <td height="25" colspan="2"> <table width="100%" height="40" border="0" cellpadding="0" cellspacing="0"> <tr align="center" valign="middle"> <td width="50%"> <iframe name="stats" src="footer.php" height="35" width="100%" scrolling="no" frameborder="0">ed2klink</iframe> </td> <td width="50%"> <iframe name="stats" src="stats.php" height="35" width="100%" scrolling="no" frameborder="0">connection</iframe> </td> </tr> </table></td> </tr></table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -