<?php

###########################
#Скрипт: Keo v1#
#Автор: GulievMMA#
#Версия: v1#
#Страна: Азербайджан#
#Город: Сумгайыт#
#Спорт: ММА#
#Сайт: KeoTop.Ru#
#Сайт: H9M.Ru#
#Телеграм: @AnarQuliyevMMA#
#E-mail: guliev.mma@gmail.com  #
#WhatsApp: +994 (77) 768-39-39#
#WhatsApp: +994 (55) 968-78-69#
############################
#Скрипт Принадлежит Мне , Продавать и Распростронять Нельзя (!)#
############################

define('NTOP', 1);
$title = 'Главная';
require_once ('system/connect.php');
require_once ('system/core.php');
require_once ('system/function.php');
require_once ('m/head.php');

/*
$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `vip` = '1'"));
if($all != 0)
{
$top = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `ban` = '0' AND `vip` = '1' ORDER BY rand() DESC LIMIT 1");
while($row = mysql_fetch_array($top))
{

echo $div_stat.'<table><tbody><tr><td width="3%">'.$div_span.'VIP</span></td>
<td width="100%"> <a href="http://'.$set['home'].'/out/'.$row['id'].'">';
echo '<b>'.$row['url'].'</b>';

echo '</a>  <b>'.$row['hosts'].'</b> | <b>'.$row['hits'].'</b> '.$adm.'
<br />';
if(mb_strlen($row['about']) > 70)
{
$text = substr($row['about'],0,70);
echo ''.$text.'...';
}
else
{
echo ''.$row['about'].'';
}
echo '<br>В топ: <b>'.$row['in'].'</b> | Из топа: <b>'.$row['out'].'</b><br>' . $kon . '</td><td width="5%">';
if ($row['skrit'] == 1 AND $row['id_user'] !== $user_data['id'] AND $user_data['level'] != 2) {
echo '<img src="/text/stat.png">';
} else {
echo '<a href="http://'.$set['home'].'/site/'.$row['url'].'"><img src="/text/stat2.png"></a>';
}
echo '</td></tr></tbody></table></div>';
}
}
echo '<a href="http://keotop.ru/wk/vip.php" class="link" style="border-top: 1px solid #fefefe">Купить VIP '.$summa2.' руб</a><br />';
*/
$vse_sait = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `hosts` >= '0'"));
echo '<div class="title"><b>'.$title.'</b></div>';

$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '11' AND `category` != '14'"));
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 `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '11' AND `category` != '14' ORDER BY `hosts` DESC LIMIT ".$start.",".$page_top."");
while($row = mysql_fetch_array($top))
{
if ($u['level'] == 2) { 
$adm = '<a href="/adm_panel/platforms.php?act=edit_sait&id='.$row['id'].'">Редактировать</a>';
} else {
$adm = '';
}
if ($id_site == $row['id']) {
$nach = '<div style="background: #fed0ed; color: #842461;">';
$kon = '</div>';
} else {
$nach = '';
$kon = '';
}
$start++;

echo $div_stat.$nach.'<table><tbody><tr><td width="3%">'.$div_span.''.$start.'</span></td>
<td width="100%"><img src="http://www.google.com/s2/favicons?domain='.$row['url'].' alt="KeoTop.Ru"/> <a href="http://'.$set['home'].'/out/'.$row['id'].'">';
if ($start == 1) echo '<font color="red"><b>'.$row['name'].'</b></font>';
elseif ($start == 2) echo '<font color="orange"><b>'.$row['name'].'</b></font>';
elseif ($start == 3) echo '<font color="green"><b>'.$row['name'].'</b></font>';
else echo '<b>'.$row['url'].'</b>';

echo '</a>  <b>'.$row['hosts'].'</b> | <b>'.$row['hits'].'</b> '.($row['vip'] == 1 ? '| <b>VIP</b>' : '').' '.($row['cy'] > 0 ? '| <b>тИЦ: '.$row['cy'].'</b>' : '').' '.($row['pr'] > 0 ? '| <b>PR: '.$row['pr'].'</b>' : '').'
';
if ($row['skrit'] == 1 AND $row['id_user'] !== $user_data['id'] AND $user_data['level'] != 2) {
echo '<img src="/img/stat1.png">';
} else {
echo '<a href="http://'.$set['home'].'/site/'.$row['url'].'"><img src="/img/stat.png"></a><br/>';
}
if(mb_strlen($row['about']) > 70)
{
$text = substr($row['about'],0,70);
echo ''.$text.'...';
}
else
{
echo ''.$row['about'].'';
}
if(isset($user_data) AND $user_data['level'] >= 2){
$ban = ($row['ban'] == 0) ? '<a href = "http://'.$set['home'].'/adm_panel/platforms.php?act=ban&id='.$row['id'].'">Забанить</a>' : '<a href = "http://'.$set['home'].'/adm_panel/platforms.php?act=ban&id='.$row['id'].'">Разблокировать</a>';
echo '<br/><a href="http://'.$set['home'].'/adm_panel/platforms.php?act=edit_sait&id='.$row['id'].'">Изменить</a> | ';
echo ''.$ban.'</a> | ';
echo '<a href="http://'.$set['home'].'/adm_panel/platforms.php?act=del_sait&id='.$row['id'].'">Удалить</a>';
}
echo '<br>В топ: <b>'.$row['in'].'</b> | Из топа: <b>'.$row['out'].'</b> </td>';

echo '</td></tr></tbody></table>' . $kon . '</div>';



}
navigation($all,$page_top,$page,'/',$total);
}
else
{
echo '<div class="stat">';
echo 'Сайтов учавствующих в Топ-100 не обнаружено!';
echo '</div>';
}
require_once ('m/foot.php');


?>