<?php
define('MTOP', 1);
$title='Рейтинг wap сайтов';
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
require_once ('head.php');
echo '<div class="title3"><b><a href="/index.php" class="open">TOP-100</a></b> <a href="/cat.php" class="open"><b>Категории</b></a></div>';
$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="title"><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 ''.$text.'..';
}
else
{
echo ''.$row['about'].'..';
}
echo '</div>';
}
navigation($all,$page_top,$page,'index.php?sort='.$sort.'&',$total);
}
else
{
echo '<div class="title"><center>Сайтов в TOP-100 не обнаружено!</center></div>';
}
echo '<div class="main">';
if(!$user_data)
{
echo '<img src="/images/design/bz.png" alt="*" /> <a href="/auth.php">Вход</a><br/>
<img src="/images/design/bz.png" alt="*" /> <a href="/reg.php">Регистрация</a><br/>';
}
echo '
<img src="/images/design/bz.png" alt="*" /> <a href="/search.php">Поиск сайта</a><br/>
<img src="/images/design/bz.png" alt="*" /> <a href="/stats.php">Статистика</a><br/>
<img src="/images/design/bz.png" alt="*" /> <a href="/contacts.php">Контакты</a><br/>
<img src="/images/design/bz.png" alt="*" /> <a href="/ban.php">Заблокированные</a><br/>';
$new_sait = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' ORDER BY `id` DESC LIMIT 1");
$new_sait_check = mysql_num_rows($new_sait);
$nsait = mysql_fetch_array($new_sait);
$new = ($new_sait_check > 0)  ? '<a href = "http://'.$set['home'].'/infos.php?id='.$nsait['id'].'">'.$nsait['name'].'</a>' : 'Нет';
echo 'Последний сайт: '.$new.'';
echo '</div>';
require_once ('foot.php');
?>