PHP Code:
$result_top = mysql_query("SELECT id, category, name, leechers, seeders From torrents WHERE visible='yes' ORDER BY seeders DESC LIMIT 10 ") or sqlerr(__FILE__, __LINE__);
echo "<table width='100%'>
<tr>
<td><div align='center'><h2>Top</h2></div></td>
</tr>
</table>";
echo "<table width='100%' border='1'>
<tr>
<th><div class='stat_head'>Cat</div></th>
<th><div class='stat_head'>Name</div></th>
<th><div class='stat_head'>Leechers</div></th>
<th><div class='stat_head'>Seechers</div></th>
</tr>";
$row_top = mysql_fetch_assoc($result_top);{
switch ($row_top['category'])
{
case "1":
$catout = "<img src='/pic/caticons/tvseries.png' width='40' height='40'>";
break;
case "2":
$catout = "<img src='/pic/caticons/movie_xvid.png' width='40' height='40'>";
break;
case "3":
$catout = "<img src='/pic/caticons/books.png' width='40' height='40'>";
break;
case "4":
$catout = "<img src='/pic/caticons/games.png' width='40' height='40'>";
break;
case "5":
$catout = "<img src='/pic/caticons/apps.png' width='40' height='40'>";
break;
default:
$catout = "<img src='/pic/caticons/apps.png' width='40' height='40'>";
}
echo "<tr>";
echo "<td width='50px' align='center'><div align='center'>$catout</div></td>";
?><td><a href="<?$BASEURL?>/details?id=<?echo $row_top['id']; ?>"class="stats_a"><? echo $row_top['name']; ?></a></td><?
echo "<td width='50px' align='center'><div align='center'>" . $row_top['leechers'] . "</div></td>";
echo "<td width='50px' align='center'><div align='center'>" . $row_top['seeders'] . "</div></td>";
echo "</tr>";
}
echo "</table>";