Файл: index.php
Строк: 31
<?php
define('MKTOP', 1);
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
$title='TОП 100';
require_once ('head.php');
$page_top = $set['page_top'];
$all = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `status` = '1' AND `ban` = '0' 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 `hosts` > '0' ORDER BY `hosts` DESC LIMIT ".$start.",".$page_top."");
while($row = mysql_fetch_array($top)){
$start++;
echo '<div class="text"><b>'.$start.'. <a href="/out/'.$row['id'].'.php">'.$row['name'].'</a></b> (<b><a href="http://'.$set['home'].'/infos.php?id='.$row['id'].'">'.$row['hosts'].'/'.$row['hits'].'</a></b>)<br/ >';
if(mb_strlen($row['about']) > 150){
$text = mb_substr($row['about'], 0, 150, 'utf-8');
echo '<a href="/infos.php?id='.$row['id'].'">'.$text.'...</a>';
}
else echo '<span style="color: #4C4C4C;">'.$row['about'].'</span></div>';
if(isset($user_data) AND $user_data['level'] >= 2){
echo '<div class="nav"><a href="/adminka/platforms.php?act=edit_sait&id='.$row['id'].'">Редактировать</a> ';
echo '<a href="/adminka/platforms.php?act=ban&id='.$row['id'].'">Заблокировать</a> ';
echo '<a href="/adminka/platforms.php?act=del_sait&id='.$row['id'].'">Удалить</a></div>';
}
}
navigation($all,$page_top,$page,'index.php?sort='.$sort.'&',$total);
}
else echo '<div class="tab">Сайтов, учавствующих в ТОП-100, не обнаружено</div>';
require_once ('foot.php');
?>