if ($limit == 10 || $subtype == "r") { $r = sql_query("SELECT c.name, c.flagpic, sum(u.uploaded)/sum(u.downloaded) AS r FROM users AS u LEFT JOIN countries AS c ON u.country = c.id WHERE u.enabled = 'yes' GROUP BY c.name HAVING sum(u.uploaded) > 1099511627776 AND sum(u.downloaded) > 1099511627776 AND count(u.id) >= 100 ORDER BY r DESC LIMIT {$limit}") or sqlerr(__FILE__, __LINE__); countriestable($r, "Top {$limit} Countries<font class=small> (ratio, with minimum 1TB uploaded, 1TB downloaded and 100 users)</font>" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=3&lim=25&subtype=r>Top 25</a>]</font>" : ""), "Рейитнг"); } } elseif ($type == 4) { print "<h1 align=center><font color=red>Under construction!</font></h1>\n"; if (!$limit || $limit > 250) { $limit = 10; } if ($limit == 10 || $subtype == "ul") { // $r = sql_query("SELECT users.id AS userid, peers.id AS peerid, username, peers.uploaded, peers.downloaded, peers.uploaded / (UNIX_TIMESTAMP(NOW()) - (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(last_action)) - UNIX_TIMESTAMP(started)) AS uprate, peers.downloaded / (UNIX_TIMESTAMP(NOW()) - (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(last_action)) - UNIX_TIMESTAMP(started)) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY uprate DESC LIMIT $limit") or sqlerr(__FILE__, __LINE__); // peerstable($r, "Top $limit Fastest Uploaders" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=4&lim=100&subtype=ul>Top 100</a>] - [<a href=topten.php?type=4&lim=250&subtype=ul>Top 250</a>]</font>" : "")); // $r = sql_query("SELECT users.id AS userid, peers.id AS peerid, username, peers.uploaded, peers.downloaded, (peers.uploaded - peers.uploadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS uprate, (peers.downloaded - peers.downloadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY uprate DESC LIMIT $limit") or sqlerr(__FILE__, __LINE__); // peerstable($r, "Top $limit Fastest Uploaders (timeout corrected)" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=4&lim=100&subtype=ul>Top 100</a>] - [<a href=topten.php?type=4&lim=250&subtype=ul>Top 250</a>]</font>" : "")); $r = sql_query("SELECT users.id AS userid, username, (peers.uploaded - peers.uploadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS uprate, IF(seeder = 'yes',(peers.downloaded - peers.downloadoffset) / (finishedat - UNIX_TIMESTAMP(started)),(peers.downloaded - peers.downloadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started))) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY uprate DESC LIMIT {$limit}") or sqlerr(__FILE__, __LINE__); peerstable($r, "Top {$limit} Fastest Uploaders" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=4&lim=100&subtype=ul>Top 100</a>] - [<a href=topten.php?type=4&lim=250&subtype=ul>Top 250</a>]</font>" : "")); } if ($limit == 10 || $subtype == "dl") { // $r = sql_query("SELECT users.id AS userid, peers.id AS peerid, username, peers.uploaded, peers.downloaded, (peers.uploaded - peers.uploadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS uprate, (peers.downloaded - peers.downloadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY downrate DESC LIMIT $limit") or sqlerr(__FILE__, __LINE__); // peerstable($r, "Top $limit Fastest Downloaders (timeout corrected)" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=4&lim=100&subtype=dl>Top 100</a>] - [<a href=topten.php?type=4&lim=250&subtype=dl>Top 250</a>]</font>" : "")); $r = sql_query("SELECT users.id AS userid, peers.id AS peerid, username, peers.uploaded, peers.downloaded,(peers.uploaded - peers.uploadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS uprate, IF(seeder = 'yes',(peers.downloaded - peers.downloadoffset) / (finishedat - UNIX_TIMESTAMP(started)),(peers.downloaded - peers.downloadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started))) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY downrate DESC LIMIT {$limit}") or sqlerr(__FILE__, __LINE__); peerstable($r, "Top {$limit} Fastest Downloaders" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=4&lim=100&subtype=dl>Top 100</a>] - [<a href=topten.php?type=4&lim=250&subtype=dl>Top 250</a>]</font>" : "")); } } end_main_frame(); //print("<p><font class=small>Started recording account xfer stats on 2003-08-31</font></p>"); stdfoot(); ?>
} if ($limit == 10 || $subtype == "r") { $r = sql_query("SELECT c.name, c.flagpic, sum(u.uploaded)/sum(u.downloaded) AS r FROM users AS u LEFT JOIN countries AS c ON u.country = c.id WHERE u.enabled = 'yes' GROUP BY c.name HAVING sum(u.uploaded) > 1099511627776 AND sum(u.downloaded) > 1099511627776 AND count(u.id) >= 100 ORDER BY r DESC LIMIT {$limit}") or sqlerr(); $HTMLOUT .= countriestable($r, sprintf($lang['country_ratio'], $limit) . ($limit == 10 && $pu ? " <font class='small'> - [<a href='topten.php?type=3&lim=25&subtype=r'>{$lang['common_top25']}</a>]</font>" : ""), $lang['common_ratio']); } } elseif ($type == 4) { // print("<h1 align='center'><font color=''red''>Under construction!</font></h1>\n"); if (!$limit || $limit > 250) { $limit = 10; } if ($limit == 10 || $subtype == "ul") { // $r = sql_query("SELECT users.id AS userid, peers.id AS peerid, username, peers.uploaded, peers.downloaded, peers.uploaded / (UNIX_TIMESTAMP(NOW()) - (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(last_action)) - UNIX_TIMESTAMP(started)) AS uprate, peers.downloaded / (UNIX_TIMESTAMP(NOW()) - (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(last_action)) - UNIX_TIMESTAMP(started)) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY uprate DESC LIMIT $limit") or sqlerr(); // peerstable($r, "Top $limit Fastest Uploaders" . ($limit == 10 && $pu ? " <font class='small'> - [<a href='topten.php?type=4&lim=100&subtype=ul'>Top 100</a>] - [<a href='topten.php?type=4&lim=250&subtype=ul'>Top 250</a>]</font>" : "")); // $r = sql_query("SELECT users.id AS userid, peers.id AS peerid, username, peers.uploaded, peers.downloaded, (peers.uploaded - peers.uploadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS uprate, (peers.downloaded - peers.downloadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY uprate DESC LIMIT $limit") or sqlerr(); // peerstable($r, "Top $limit Fastest Uploaders (timeout corrected)" . ($limit == 10 && $pu ? " <font class='small'> - [<a href='topten.php?type=4&lim=100&subtype=ul'>Top 100</a>] - [<a href='topten.php?type=4&lim=250&subtype=ul'>Top 250</a>]</font>" : "")); $r = sql_query("SELECT users.id AS userid, username, (peers.uploaded - peers.uploadoffset) / (last_action - started) AS uprate, IF(seeder = 'yes',(peers.downloaded - peers.downloadoffset) / (finishedat - started),(peers.downloaded - peers.downloadoffset) / (last_action - started)) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY uprate DESC LIMIT {$limit}") or sqlerr(); $HTMLOUT .= peerstable($r, sprintf($lang['peers_fastestup'], $limit) . ($limit == 10 && $pu ? " <font class='small'> - [<a href='topten.php?type=4&lim=100&subtype=ul'>{$lang['common_top100']}</a>] - [<a href='topten.php?type=4&lim=250&subtype=ul'>{$lang['common_top250']}</a>]</font>" : "")); } if ($limit == 10 || $subtype == "dl") { // $r = sql_query("SELECT users.id AS userid, peers.id AS peerid, username, peers.uploaded, peers.downloaded, (peers.uploaded - peers.uploadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS uprate, (peers.downloaded - peers.downloadoffset) / (UNIX_TIMESTAMP(last_action) - UNIX_TIMESTAMP(started)) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY downrate DESC LIMIT $limit") or sqlerr(); // peerstable($r, "Top $limit Fastest Downloaders (timeout corrected)" . ($limit == 10 && $pu ? " <font class='small'> - [<a href='topten.php?type=4&lim=100&subtype=dl'>Top 100</a>] - [<a href='topten.php?type=4&lim=250&subtype=dl'>Top 250</a>]</font>" : "")); $r = sql_query("SELECT users.id AS userid, peers.id AS peerid, username, peers.uploaded, peers.downloaded,(peers.uploaded - peers.uploadoffset) / (last_action - started) AS uprate, IF(seeder = 'yes',(peers.downloaded - peers.downloadoffset) / (finishedat - started),(peers.downloaded - peers.downloadoffset) / (last_action - started)) AS downrate FROM peers LEFT JOIN users ON peers.userid = users.id ORDER BY downrate DESC LIMIT {$limit}") or sqlerr(); $HTMLOUT .= peerstable($r, sprintf($lang['peers_fastestdown'], $limit) . ($limit == 10 && $pu ? " <font class='small'> - [<a href='topten.php?type=4&lim=100&subtype=dl'>{$lang['common_top100']}</a>] - [<a href='topten.php?type=4&lim=250&subtype=dl'>{$lang['common_top250']}</a>]</font>" : "")); } } $HTMLOUT .= end_main_frame(); print stdhead($lang['head_title']) . $HTMLOUT . stdfoot(); ?>
echo textbbcode("comment", "body") . "<br />"; echo "<input type=\"submit\" value=\"" . T_("ADDCOMMENT") . "\" />"; echo "</form></center>"; } echo "</div>"; end_frame(); echo "<div class='hiddenframe' id='localactiv'>"; if ($user["privacy"] != "strong" || $CURUSER["control_panel"] == "yes" || $CURUSER["id"] == $user["id"]) { begin_frame(T_("LOCAL_ACTIVITY")); $res = SQL_Query_exec("SELECT torrent, uploaded, downloaded FROM peers WHERE userid = '{$id}' AND seeder = 'yes'"); if (mysql_num_rows($res) > 0) { $seeding = peerstable($res); } $res = SQL_Query_exec("SELECT torrent, uploaded, downloaded FROM peers WHERE userid = '{$id}' AND seeder = 'no'"); if (mysql_num_rows($res) > 0) { $leeching = peerstable($res); } if ($seeding) { print "<b>" . T_("CURRENTLY_SEEDING") . ":</b><br />{$seeding}<br /><br />"; } if ($leeching) { print "<b>" . T_("CURRENTLY_LEECHING") . ":</b><br />{$leeching}<br /><br />"; } if (!$leeching && !$seeding) { print "<b>" . T_("NO_ACTIVE_TRANSFERS") . "</b><br />"; } end_frame(); echo "</div>"; echo "<div class='hiddenframe' id='uploadedtor'>"; begin_frame(T_("UPLOADED_TORRENTS")); //page numbers