Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[ADDON] Torrent browsing like tbdev
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2009-02-21 15:48:45
Taken from v1.x

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&amp;";

$addparam .= "c$row[id]=1&amp;";

$thisurl .= "c$row[id]=1&amp;";

}

$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).
browse.png
browse.png
Unknown User
2009-02-21 15:53:00
thanks a lot TS, you're the best;)

I'll test it very soon  :lol:

Edit:

works fine, thank you

in torrents-search.php, you can also delete:

<? print("" . IN . "\n"); ?>

<select name="cat">

<option value="0">(All types)</option>

<?





$cats = genrelist();

$catdropdown = "";

foreach ($cats as $cat) {

$catdropdown .= "<option value=\"" . $cat["id"] . "\"";

if ($cat["id"] == $_GET["cat"])

$catdropdown .= " selected=\"selected\"";

$catdropdown .= ">" . htmlspecialchars($cat["parent_cat"]) . ": " . htmlspecialchars($cat["name"]) . "</option>\n";

}

?>

<?= $catdropdown ?>

</select>
Unknown User
2009-03-23 19:46:57
you can also delete torrents.php on torrents-search.php is that  :rolleyes:

Quote:
echo "<CENTER><B>Categories:</B> ";$catsquery = mysql_query("SELECT distinct parent_cat FROM categories ORDER BY parent_cat")or die(mysql_error());

echo " - <a href=torrents.php>Show All</a>";

while($catsrow = MYSQL_FETCH_ARRAY($catsquery)){

echo " - <a href=torrents.php?parent_cat=".urlencode($catsrow['parent_cat']).">$catsrow[parent_cat]</a>";

}




thank you for this hack
Unknown User
2010-06-26 23:16:42
thanks for this mod ^^
Unknown User
2010-09-06 13:00:30
thx so much for this hack   ;)  ;)
Unknown User
2012-01-06 06:06:14
is easy the checkbox is first ? like screen

Screenshot.png
Screenshot.png
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728