Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
Thread Tools
  #1  
Old 24th February 2013, 10:55
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 278
Default Top 10 Torrents on Index
Put this code in index.php where you want to show:

PHP Code:
<?    
begin_frame
("<font color=lime >Top 10 Torrents");
$ress mysql_query("SELECT id,category,seeders, leechers, size, name, times_completed from torrents ORDER BY seeders + leechers DESC LIMIT 10") or sqlerr(__FILE____LINE__);
$num mysql_num_rows($ress);

if (
$num 0) {
print(
"<center><table border=1 cellspacing=0  cellpadding=3 width=100%><tr></center>");
print(
"<td align=center><font size=+1><b>Type</font></b></td>");
//print("<td align=center><font size=+1><b>Rank</font></b></td>");
print("<td align=center><font size=+1><b>Top 5 Torrents</font></b></td>");
print(
"<td align=center width=5%><font size=+1><b>Size</b></font></td>");
print(
"<td align=center width=5%><font size=+1><b>Snatches</b></font></td>");
print(
"<td align=center width=5%><font size=+1><b>Seeders</b></font></td>");
print(
"<td align=center width=5%><font size=+1><b>Leechers</b></font></td></tr>");

for (
$i 0$i $num; ++$i)
{
while (
$row mysql_fetch_assoc($ress)) {


//////// Retrieve Category Image //////////
$cros mysql_query("SELECT name, image FROM categories WHERE id=$row[category]");
if (
mysql_num_rows($cros) == 1)
{
$corr mysql_fetch_assoc($cros);
$cat_img "<img src=$BASEURL/pic/" $corr[image] . " border=0 alt='$corr[name]'>";
}
/////// End Category Image //////////////

//Rank Start
$i = ++$i;
//Rank End

//print("<tr><td>$cat_img</td>");
print("<td width=40 align=left>$cat_img</td>"); //category images
//print("<td align=center>$i</td>"); //rank
print("<td width=100% align=left>$i. <a href=details.php?id=$row[id]><b>$row[name]</b></a></td>"); //name (if you want to use the rank colume delete the "$i." that is before the <a href=details...>)
print("<td align=center>" .mksize($row['size'])."</td>"); //size
print("<td align=center>" .number_format($row['times_completed'])."</td>"); //snatches
print("<td align=center><font color=red>" .number_format($row['seeders'])."</font></td>"); //seeders
print("<td align=center>" .number_format($row['leechers'])."</td></tr>\n"); //leechers
}
}
}
print(
"</tr></table>");

    

end_frame();
?>
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
Reply

Tags
10 , index , top , torrents


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 18:43. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.