Файл: New_top/Modules/main.php
Строк: 68
<?php
$title = 'Главная страница';
require_once ('Sys/head.php');
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/Sys/in/rekl_ver.php";
include_once($path);
echo '<div class="block">';
if(!isset($user_data))
{
echo ' <a href="http://'.$_SERVER['HTTP_HOST'].'/m/authentication"><b style="color:#ffffff">Вход</b></a> | <a href="http://'.$_SERVER['HTTP_HOST'].'/m/registration"><b style="color:#ffffff">Регистрация</b></a></div>';
}
else
{
if($str != 'authentication')
{
echo '<a href="http://'.$_SERVER['HTTP_HOST'].'/m/office"><b
style="color:#ffffff">Кабинет</b></a> | <a href="http://'.$_SERVER['HTTP_HOST'].'/exit"><b
style="color:#ffffff">Выход</b></a></div>';
}
}
echo '<div class="li"> ¤ <a href="http://mastwap.ru">Форум вап мастеров </a></div>';
echo '<div class="li"> ¤ <a href="http://dcms-love.ru.ru">Социальная сеть ! </a></div>';
///////////////////////////// Новости
$news = $mysqli->query("SELECT * FROM `".$prefix."news` ORDER BY `time` DESC LIMIT ".$set['indexNews']."");
while($row = $news->fetch_assoc())
{
echo '<div class="li">';
echo '<small>';
echo bbCodes(nl2br($row['text']));
echo '</small>';
echo '</div>';
}
$cat_all = $mysqli->query("SELECT `id` FROM `".$prefix."cat`")->num_rows;
echo '<div class="block" ><b> <b style="color:#ffffff">Top100 </b> | <a href="http://'.$_SERVER['HTTP_HOST'].'/m/category"><b style="color:#ffffff">Категории </b></b></a></div>';
$all = $mysqli->query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '21'")->num_rows;
if($all == 0)
{
echo '<div class="li">';
echo 'Активных сайтов не найдено.<br/>';
echo '</div>';
}
else
{
$total=intval(($all-1)/$pageTop)+1;
$page = (isset($_GET['page'])) ? abs(intval($_GET['page'])) : '';
if(empty($page) OR $page < 0)
{
$page = 1;
}
if($page > $total)
{
$page = $total;
}
$past = intval($all/$pageTop);
$start = $page*$pageTop-$pageTop;
$top100 = $mysqli->query("SELECT `id`,`name`,`about`,`hosts`,`hits`,`in`,`out`,`url` FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '21' ORDER BY `hosts` DESC LIMIT ".$start.",".$pageTop."");
$idd = intval($_GET['id']);
while($row = $top100->fetch_assoc())
{
if($row['id']==$idd){$u1='<u>'; $u2='</u>';} else{$u1=''; $u2='';}
$start++;
echo '<div class="li"><b>'.$start.'</b></span> <a href="http://'.$_SERVER['HTTP_HOST'].'/out/'.$row['id'].'"><font color=#4682B4><b>'.$row['url'].'</small>'.$u2.'</b></font></a>';
echo ' ('.$row['hosts'].') <a href="http://'.$_SERVER['HTTP_HOST'].'/stats/'.$row['id'].'" > <img src="http://'.$_SERVER['HTTP_HOST'].'/Design/images/ini/stat/s.gif" alt="*" /></a><br />';
if(mb_strlen($row['about']) > 58)
{
$text = mb_substr($row['about'],0,58);
echo ''.$text.'...</div>';
}
else
{
echo ''.$row['about'].'</div>';
}
$online_site = $mysqli->query("SELECT * FROM `".$prefix."saitsOnline` WHERE `sid` = '".$row['id']."' AND `time` > '".($time-180)."'")->num_rows;
}
if($all > $pageTop)
{
navigation($total,$page,'http://'.$_SERVER['HTTP_HOST'].'/');
}
}
///////////////////////////////
$newsAll = $mysqli->query("SELECT `id` FROM `".$prefix."news`")->num_rows;
$itnewsAll = $mysqli->query("SELECT `id` FROM `".$prefix."itnews`")->num_rows;
$ban = $mysqli->query("SELECT `id` FROM `".$prefix."sait` WHERE `ban` = '1'")->num_rows;
///////////////////////////////
echo '<div class="block"> <b style="color:#ffffff">Главное меню</b></div>';
echo '<div class="li">
<img src="http://'.$_SERVER['HTTP_HOST'].'/Design/images/ini/menu/3.png" alt="*" /> <a href="http://'.$_SERVER['HTTP_HOST'].'/m/news">Новости ['.$newsAll.']</a></div>';
echo '<div class="li">
<img src="http://'.$_SERVER['HTTP_HOST'].'/Design/images/ini/menu/4.png" alt="*" /> <a href="http://'.$_SERVER['HTTP_HOST'].'/m/category">Категории топа ['.$cat_all.']</a></div>';
echo '<div class="li"><img src="http://'.$_SERVER['HTTP_HOST'].'/Design/images/ini/menu/5.png" alt="*" /> <a href="http://'.$_SERVER['HTTP_HOST'].'/m/ban">Нарушители ['.$ban.']</a></div>';
echo '<div class="li"><img src="http://'.$_SERVER['HTTP_HOST'].'/Design/images/ini/menu/6.png" alt="*" /> <a href="http://'.$_SERVER['HTTP_HOST'].'/m/allStats">Общая статистика</a></div>';
echo '<div class="block"> </b> <a href="http://'.$_SERVER['HTTP_HOST'].'/m/contacts"><b style="color:#ffffff">Контакты</b></b></a> ::: </b> <a href="http://'.$_SERVER['HTTP_HOST'].'/m/rules"><b style="color:#ffffff">Правила</b></b></a> </div>';
echo '</div>';
?>