$page_top = $set['page_top'];
$all = mysql_num_rows(mysql_query("SELECT * FROM sait WHERE status = '1' AND ban = '0' AND category != '91214' AND hosts > '0'"));
if($all != 0) {
$total = intval(($all - 1) / $page_top) + 1;
$page = abs(intval($_GET['page']));
if(empty($page) OR $page < 0) $page = 1;
if($page > $total) $page = $total;
$past = intval($all / $page_top);
$start = $page * $page_top - $page_top;
$top = mysql_query("SELECT * FROM sait WHERE status = '1' AND ban = '0' AND category != '91214' AND hosts > '0' ORDER BY hosts DESC LIMIT ".$start.",".$page_top."");
while($row = mysql_fetch_array($top)) {
$start++;
if($start == 1) $icon = 'top-gold';
if($start == 2) $icon = 'top-silver';
if($start == 3) $icon = 'top-bronze';
if($start >= 4) $icon = 'top-icon';
echo '<table width="100%" cellpadding="5" cellspacing="0" class="main"><tr><td width="1%"><span class="'.$icon.'">'.$start.'</span></td><td width="81%"><h3 style="font:inherit;display:inline-block;margin:0"><a href="/out.php?id='.$row['id'].'" title="Посетить сайт '.$row['url'].'" id="outlink" target="_blank" rel="noopener">'.$row['url'].'</a></h3>'.($row['category'] == 4 ? ' <img src="/images/18.png" title="Сайт категории 18+" alt="Сайт категории 18+"/>':'').' <a href="/stats/'.$row['id'].'" title="Статистика сайта '.$row['url'].'" rel="noopener"><i class="fa fa-chart-line" style="color:#f5f5f5"></i></a><br/>';
if(mb_strlen($row['about']) > 92) {
$text = mb_substr($row['about'], 0, 92, 'utf-8');
echo $text.'…';
} else {
echo $row['about'];
}
echo '</td><td width="18%"><span class="badge" style="float:right;margin-right:-9px"><a href="/stats/'.$row['id'].'" title="Статистика сайта '.$row['url'].'" rel="noopener"><span class="hosts">'.$row['hosts'].'</span> <span class="hits">'.$row['hits'].'</span></a></span></td></tr></table>';
}