Файл: ban.php
Строк: 50
<?php
define('MKTOP', 1);
$title = 'Заблокированные';
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
require_once ('head.php');
$count = mysql_num_rows(mysql_query("SELECT * FROM `sait` WHERE `ban` = '1'"));
if($count > 0){
$total=intval(($count-1)/$page_sait)+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0) $page = 1;
if($page > $total)$page = $total;
$past=intval($count/$page_sait);
$start=$page*$page_sait-$page_sait;
echo '<div class="nav">';
if($_GET['sort'] == 'hosts' OR $_GET['sort']==null) echo 'Хосты'; else echo '<a href="ban.php?sort=hosts">Хосты</a>'; echo ' | ';
if($_GET['sort'] == 'hits') echo 'Хиты'; else echo '<a href="ban.php?sort=hits">Хиты</a>'; echo ' | ';
if($_GET['sort'] == 'in') echo 'В топ'; else echo '<a href="ban.php?sort=in">В топ</a>'; echo ' | ';
if($_GET['sort'] == 'out') echo 'Из топа'; else echo '<a href="ban.php?sort=out">Из топа</a>';
echo '</div>';
if($_GET['sort'] == 'hits') $sort= 'hits';
elseif($_GET['sort'] == 'in') $sort= 'in';
elseif($_GET['sort'] == 'out') $sort= 'out';
else $sort= 'hosts';
$saits = mysql_query("SELECT * FROM `sait` WHERE `ban` = '1' ORDER BY `".$sort."` DESC LIMIT ".$start.",".$page_sait."");
while($row = mysql_fetch_array($saits)){
$start++;
echo '<a class="link" href="/out/'.$row['id'].'.php">'.$start.') '.$row['name'].' <span class="stat">'.$row['hosts'].'/'.$row['hits'].'</span></a>';
if(isset($user_data) AND $user_data['level'] >= 2){
if(mb_strlen($row['about']) > 50){
$text = mb_substr($row['about'], 0, 50, 'utf-8');
echo '<a class="link" href="/infos.php?id='.$row['id'].'">'.$text.'...</a>';
}
else echo '<a class="link" href="/infos.php?id='.$row['id'].'">'.$row['about'].'</a>';
}
echo '<div class="text">Причина блокировки: '.$row['ban_reason'].'</div>';
if(isset($user_data) AND $user_data['level'] >= 2){
echo '<div class="text"><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($count,$page_sait,$page,'ban.php?sort='.$sort.'&',$total);
}
else echo '<div class="text">Нет заблокированных сайтов</div>';
require_once ('foot.php');
?>