Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Torrent Trader
Reply
  #1  
Old 19th September 2022, 10:53
hax0r hax0r is offline
Banned
 
Join Date: Sep 2022
Posts: 12
Thumbs down Seeders_wanted_mod
sqlesc required?! Just asking as scanning through blocks.php
Code:
<?php
if($CURUSER)
if (!$site_config["MEMBERSONLY"] || $CURUSER) {
	begin_block(T_("SEEDERS_WANTED"));

	$external = "external = 'no'";
	// Uncomment below to include external torrents
	$external = 1;

	$expires = 600; // Cache time in seconds
	if (($rows = $TTCache->Get("seedwanted_block", $expires)) === false) {
		$res = SQL_Query_exec("SELECT id, name, seeders, leechers FROM torrents WHERE seeders = 0 AND leechers > 0 AND banned = 'no' AND ".sqlesc($external)." ORDER BY leechers DESC LIMIT 5");
		$rows = array();

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

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


	if (!$rows) {
		echo "<br />".T_("NOTHING_FOUND")."<br />";
	} else {
		echo "<div id='sNeeded' class='bMenu'><ul>\n";
		foreach ($rows as $row) {
			$char1 = 18; //cut length
			$smallname = htmlspecialchars(CutName($row["name"], $char1));
			echo "<li><a href='torrents-details.php?id=$row[id]' title='".htmlspecialchars($row["name"])."'>$smallname</a><br /> - [".T_("LEECHERS").": " . number_format($row["leechers"]) . "]</li>\n";
		}
	echo "</ul></div>\n";
	}
	end_block();
}
?>
Reply With Quote
  #2  
Old 4th October 2022, 01:16
EagleLake EagleLake is offline
Senior Member
 
Join Date: Aug 2011
France
Posts: 31
Default
hello



create name this seedwanted_block.php into folder blocks



<?php if($CURUSER) if (!$site_config["MEMBERSONLY"] || $CURUSER) { begin_block(T_("SEEDERS_WANTED")); $external = "external = 'no'"; // Uncomment below to include external torrents $external = 1; $expires = 600; // Cache time in seconds if (($rows = $TTCache->Get("seedwanted_block", $expires)) === false) { $res = SQL_Query_exec("SELECT id, name, seeders, leechers FROM torrents WHERE seeders = 0 AND leechers > 0 AND banned = 'no' AND ".sqlesc($external)." ORDER BY leechers DESC LIMIT 5"); $rows = array(); while ($row = mysqli_fetch_assoc($res)) { $rows[] = $row; } $TTCache->Set("seedwanted_block", $rows, $expires); } if (!$rows) { echo "<br />".T_("NOTHING_FOUND")."<br />"; } else { echo "<div id='sNeeded' class='bMenu'><ul>\n"; foreach ($rows as $row) { $char1 = 18; //cut length $smallname = htmlspecialchars(CutName($row["name"], $char1)); echo "<li><a href='torrents-details.php?id=$row[id]' title='".htmlspecialchars($row["name"])."'>$smallname</a><br /> - [".T_("LEECHERS").": " . number_format($row["leechers"]) . "]</li>\n"; } echo "</ul></div>\n"; } end_block(); } ?>
Reply With Quote
  #3  
Old 26th December 2022, 13:13
BamBam0077 BamBam0077 is offline
Banned
 
Join Date: Jul 2013
P2P
Posts: 410
Smile
Thank You
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 15:00. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.