Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Top 10 Torrents on Index (http://www.bvlist.com/showthread.php?t=8911)

Chez 24th February 2013 10:55

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();
?>



All times are GMT +2. The time now is 19:24.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.