"Топ 5 закачек" создаем в Админке блок и в содержание кидаем вот это
Код:
<?php if (!defined('BLOCK_FILE')) { header("Location: ../index.php"); exit; } $res = mysql_query("SELECT id,category,seeders, torrents.image1, leechers, name from torrents ORDER BY seeders + leechers DESC LIMIT 1") or sqlerr(__FILE__, __LINE__); $num = mysql_num_rows($res); if ($num > 0) { $content .= "<table border=1 cellspacing=0 cellpadding=5 width=100%><tr>"; $content .= "<td class=colhead align=center width=15%><b>Сидеров</b></td>"; $content .= "<td class=colhead align=center width=15%><b>Личеров</b></td></tr>"; for ($i = 0; $i < $num; ++$i) { while ($row = mysql_fetch_assoc($res)) { $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/cats/" . $corr[image] . " border=0 alt='$corr[name]'>"; } $content .= "<center><a href=details.php?id=$row[id]><img border=0 width=100% src='thumbnail.php?$row[image1]'/></a></center>"; $content .= "<td align=center><font color=red>" .number_format($row['seeders'])."</font></td>"; $content .= "<td align=center>" .number_format($row['leechers'])."</td></tr>\n"; } } } $content .= "</tr></table>"; ?>