Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Torrent Trader > Mods & Themes
Reply
  #1  
Old 19th September 2022, 10:58
hax0r hax0r is offline
Banned
 
Join Date: Sep 2022
Posts: 12
Exclamation Most_Active_Mod
Code:
<?php
if($CURUSER)
if (!$site_config["MEMBERSONLY"] || $CURUSER) {
	begin_block(T_("MOST_ACTIVE"));

	$where = "WHERE banned = 'no' AND visible = 'yes'";
	//uncomment the following line to exclude external torrents
	//$where = "WHERE external !='yes' AND banned ='no' AND visible = 'yes'"

	$expires = 600; // Cache time in seconds
	if (($rows = $TTCache->Get("mostactivetorrents_block", $expires)) === false) {
		$res = SQL_Query_exec("SELECT id, name, seeders, leechers FROM torrents ".sqlesc($where)." ORDER BY seeders + leechers DESC, seeders DESC, added ASC LIMIT 10");

		$rows = array();
		while ($row = mysqli_fetch_assoc($res))
			$rows[] = $row;

		$TTCache->Set("mostactivetorrents_block", $rows, $expires);
	}

	if ($rows) {
		foreach ($rows as $row) {
				$char1 = 18; //cut length
				$smallname = htmlspecialchars(CutName($row["name"], $char1));
				echo "<a href='torrents-details.php?id=$row[id]' title='".htmlspecialchars($row["name"])."'>$smallname</a><br /> - [S: " . number_format($row["seeders"]) . " - L: " . number_format($row["leechers"]) . "]<br /><br />\n";
		}

} else {
	print("<center>".T_("NOTHING_FOUND")."</center>\n");
}
end_block();
}
?>
/[Font size=48pt]/ Sqlesc added just incase required[/font]
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 14:41. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.