Файл: index.php
Строк: 51
<?php
///////////////////////////////////////
// //
// Автор скрипта: maxim529 //
// Email: kaznet@spaces.ru //
// ICQ: 632360940 //
// //
///////////////////////////////////////
define('MKTOP', 1);
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
$title='Toп-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 '<span style="float:right;padding-right: 5px;padding-top: 5px;"><a href="/infos.php?id='.$row['id'].'"><img src="/img/rat.png"></a></span>';
echo '<div class="links"><b><span class = "st2">'.$start.'</span></b> <img src="http://www.google.com/s2/favicons?domain='.$row['url'].'"/> <a href="/out/'.$row['id'].'.php"><span style="color: #616A70;"> '.$row['name'].' </span></a><font size="1"><b><span class = "st1"> '.$row['hosts'].'</span><span class = "st2">'.$row['hits'].'</span></b></font> <a href="http://'.$set['home'].'/stats/'.$row['id'].'"></a><br/><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="links"><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="links">Сайтов, учавствующих в Тор-100, не обнаружено</div>';
require_once ('foot.php');
?>