rendered paste body<?php
require "include/bittorrent.php";
error_reporting(1);
dbconn();
loggedinorreturn();
stdhead("Torrents Needing Seeds");
$res = mysql_query("SELECT id, name, seeders, leechers, added FROM torrents WHERE leechers > 0 AND seeders = 0 ORDER BY leechers DESC LIMIT 40");
if (mysql_num_rows($res) > 0) {
print("<table class=main border=1 cellspacing=0 cellpadding=5>\n");
print("<tr><td class=\"colhead\">Torrent</td><td class=\"colhead\">Seeders</a></td><td class=\"colhead\">Leechers</td></tr>\n");
while ($arr = mysql_fetch_assoc($res)) {
$torrname = htmlspecialchars($arr['name']);
if (strlen($torrname) > 55)
$torrname = substr($torrname, 0, 55) . "...";
$ttl = (28*24) - floor((gmtime() - sql_timestamp_to_unix_timestamp($arr["added"])) / 3600);
print("<br /><tr><td><a href=\"details.php?id=".$arr['id']."&hit=1\" alt=\"".$arr['name']."\" title=\"".$arr['name']."\">".$torrname."</td><td><font color=\"red\">".$arr['seeders']."</a></td><td>".number_format($arr['leechers'])."</td></tr>\n");
}
print("</table>\n");
} else
print("-- There are no torrents needing seeds right now --\n");
stdfoot();
?>