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
Torrents.php
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Support

2023-10-17 06:21:04
Hello i wont to limit torrents.php torrents nun files

i have 2.5Milion torrents and i wont to limit the torrents last 100K on display

//Get Total For Pager
$res = mysql_query("SELECT COUNT(*) FROM torrents LEFT JOIN categories ON category = categories.id $where ") or die(mysql_error());
$row = mysql_fetch_array($res);
$count = $row[0];
//get sql info
if ($count) {
list($pagertop, $pagerbottom, $limit) = pager(35, $count, "torrents.php?" . $addparam);
$query = "SELECT torrents.id, torrents.category, torrents.sticky, torrents.recommendedx, torrents.viptorrents, torrents.rosubbed, torrents.hardcoded, torrents.italiansub, torrents.dublatro, torrents.dubbed, torrents.multilang, torrents.multilang, torrents.remux, torrents.HDR, torrents.3d, torrents.flacdst, torrents.adson, torrents.VR, torrents.frenchsub, torrents.russiansub, torrents.engsub, torrents.germansub, torrents.4khdr, torrents.UHD, torrents.fhd,torrents.SD, torrents.KoreanHC, torrents.description, torrents.leechers,  torrents.seeders, torrents.name,  torrents.size, torrents.added, torrents.torrentlang, torrents.owner, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy,  IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id $where $orderby $limit";
$res = mysql_query($query) or die(mysql_error());
}else{
unset($res);
}


UPDATE !
i think i resove the problem from this line torrents.ratingsum / torrents.numratings, by removing it
Last edited by Extremlym66 on 2023-10-17 07:40:06
2023-10-17 06:40:58
SELECT COUNT(*) FROM torrents LEFT JOIN categories ON category = categories.id $where
need this to have a limit page is verry low because of num of torrents

ASK chatgpt and the result was this
$maxResults = 10; // Change this to the number of results you want to retrieve

$query = "SELECT COUNT(*) FROM torrents LEFT JOIN categories ON category = categories.id $where LIMIT $maxResults";
$res = mysql_query($query) or die(mysql_error());

$row = mysql_fetch_array($res);
$count = $row[0];

BUT STIL SLOW
Last edited by Extremlym66 on 2023-10-17 06:54:41
2023-10-17 09:35:48
need some help plss is verry important
2023-10-19 07:57:15
Hi mate,
you already have some form of limitation in this query

$limit

chack also
$orderby

to ...


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2023-10-25 23:17:50
Why use mysql in TT the right query is SQL_Query_exec???

Very very bad report
https://gtmetrix.com/reports/extremlymtorrents.ws/HKsANATw/
Last edited by coco on 2023-10-25 23:34:29
2023-12-12 09:24:55
if ($_GET["order"] == "asc" || ($_GET["sort"] != "id" && !$_GET["order"])) {
$sort .= " ASC";
$addparam .= "order=asc&";
} else {
$sort .= " DESC";
$addparam .= "order=desc&";
}

$orderby = "ORDER BY $sort";

}else{
$orderby = "ORDER BY torrents.sticky ASC, torrents.id DESC  ";
$_GET["sort"] = "id";
$_GET["order"] = "desc";
}
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: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728