and script in takepage.php
PHP Code:
<?
require_once("include/bittorrent.php");
dbconn(false);
header ("Content-Type: text/html; charset=" . $tracker_lang['language_charset']);
$page = (int) $_GET["page"];
if (!isset($page)) {
stdmsg($tracker_lang["error"], "Не пытайся меня взломать!");
}
$count = (int) $_GET["count"];
$torrentsperpage = (int) $_GET["torrentsperpage"];
$where = convert_text(urldecode(decode_unicode_url($_GET["where"])));
$orderby = "ORDER BY torrents.sticky ASC, torrents.id DESC";
list($pagertop, $pagerbottom, $limit) = browsepager($torrentsperpage, $count, "browse.php?" . $addparam);
$query = "SELECT torrents.id, torrents.moderated, torrents.moderatedby, torrents.category, torrents.leechers, torrents.seeders, torrents.free, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.sticky, torrents.owner," .
"IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, categories.name AS cat_name, categories.image AS cat_pic, users.username, users.class".($CURUSER ? ", EXISTS(SELECT * FROM readtorrents WHERE readtorrents.userid = ".sqlesc($CURUSER["id"])." AND readtorrents.torrentid = torrents.id) AS readtorrent" : ", 1 AS readtorrent")." FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $orderby $limit";
$res = mysql_query($query) or die(mysql_error());
print("<table id=\"pager\" class=\"embedded\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td class=\"index\" colspan=\"12\">");
print($pagertop);
print("</td></tr>");
torrenttable($res, "index");
print("<tr><td class=\"index\" colspan=\"12\">");
print($pagerbottom);
print("</td></tr></table>");
?>