Taken from v1.x
torrents.php, find:
and remove it

Added to SVN (R216).
torrents.php, find:
$category = $_GET["cat"];replace with:$category = (int) $_GET["cat"];
find:
$where = implode(" AND ", $wherea);
add after:
$wherecatina = array();
$wherecatin = "";
$res = mysql_query("SELECT id FROM categories");
while($row = mysql_fetch_assoc($res)){
if ($_GET["c$row[id]"]) {
$wherecatina[] = $row[id];
$addparam .= "c$row[id]=1&";
$thisurl .= "c$row[id]=1&";
}
$wherecatin = implode(", ", $wherecatina);
}
find:
echo " - <a href=torrents.php?parent_cat=".urlencode($catsrow['parent_cat']).">$catsrow[parent_cat]</a>";
}
add after:
?>
<BR><BR>
<form method="get" action="torrents.php">
<table class=bottom align="center">
<tr align='right'>
<?
$i = 0;
$cats = mysql_query("SELECT * FROM categories ORDER BY parent_cat, name");
while ($cat = mysql_fetch_assoc($cats)) {
$catsperrow = 5;
print(($i && $i % $catsperrow == 0) ? "</tr><tr align='right'>" : "");
print("<td style=\"padding-bottom: 2px;padding-left: 2px\"><a class=catlink href=torrents.php?cat={$cat["id"]}>".htmlspecialchars($cat["parent_cat"])." - " . htmlspecialchars($cat["name"]) . "</a><input name=c{$cat["id"]} type=\"checkbox\" " . (in_array($cat["id"], $wherecatina) ? "checked " : "") . "value=1></td>\n");
$i++;
}
echo "<tr align='center'><td colspan=$catsperrow align='center'><input type='submit' value='Go'></td></tr>";
echo "</tr></table></form>";
torrents-search.php, find:
$wherea[] = "banned = 'no'";
add after:
$wherecatina = array();
$wherecatin = "";
$res = mysql_query("SELECT id FROM categories");
while($row = mysql_fetch_assoc($res)){
if ($_GET["c$row[id]"]) {
$wherecatina[] = $row[id];
$addparam .= "c$row[id]=1&";
$addparam .= "c$row[id]=1&";
$thisurl .= "c$row[id]=1&";
}
$wherecatin = implode(", ", $wherecatina);
}
if ($wherecatin)
$wherea[] = "category IN ($wherecatin)";
find:
echo " - <a href=torrents.php?parent_cat=".urlencode($catsrow['parent_cat']).">$catsrow[parent_cat]</a>";
}
add after:
?>
<BR><BR>
<form method="get" action="torrents-search.php">
<table class=bottom align="center">
<tr align='right'>
<?
$i = 0;
$cats = mysql_query("SELECT * FROM categories ORDER BY parent_cat, name");
while ($cat = mysql_fetch_assoc($cats)) {
$catsperrow = 5;
print(($i && $i % $catsperrow == 0) ? "</tr><tr align='right'>" : "");
print("<td style=\"padding-bottom: 2px;padding-left: 2px\"><a class=catlink href=torrents.php?cat={$cat["id"]}>".htmlspecialchars($cat["parent_cat"])." - " . htmlspecialchars($cat["name"]) . "</a><input name=c{$cat["id"]} type=\"checkbox\" " . (in_array($cat["id"], $wherecatina) ? "checked " : "") . "value=1></td>\n");
$i++;
}
echo "</tr></table>";
find:
<form method="get" action="torrents-search.php">and remove it

Added to SVN (R216).