<?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#
############################
#Скрипт Принадлежит Мне , Продавать и Распростронять Нельзя (!)#
############################

$microtime = microtime(1);
// rasmlarni almashtirish funksiyasi
function anim($anim)
{
    $anim=str_replace('stat2.png', 'stat.gif', $anim);
	$anim=str_replace('/text/ads.png', '/img/index/ico.gif', $anim);
	$anim=str_replace('copy.png', 'copy.gif', $anim);
		return $anim;
	}
if ($_GET['anim'] == 'on') {
$_SESSION['giff'] = '1';
} elseif ($_GET['anim'] == 'off') {
unset($_SESSION['giff']);
}

if ($_SESSION['giff'] == '1') {
ob_start('anim');
}
echo '<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="application/xhtml xml; charset=utf-8"/>

<meta http-equiv="Content-Style-Type" content="text/css" />';

//////////////////////// Р’С‹РІРѕРґ РњРµС‚Р° РўР•Р“
echo '<meta name="keywords" content="'.(isset($key) ? $key : $set['meta_k']).'"/>';
echo '<meta name="description" content="'.(isset($des) ? $des : $set['meta_d']).'"/>
<meta name="yandex-verification" content="5cc8421c00391d25" />
<meta name="google-site-verification" content="6brWrJVjPnUCVt33gJYpgxGKoTZiB_3w4aLQk0w1KJ4" />';

/////////////////////

echo '<link rel="shortcut icon" type="image/x-icon" href="http://'.$set['home'].'/text/stat2.png"/>

<link rel="stylesheet" type="text/css" href="/text_web/css.css" />

<title>'.$title.' | '.$set['top_name'].'</title>';

/////////////////////////////

echo '</head><body>';
/////////////////////////////////////////

echo '<div class="panel"><a href="/"><img src="/text/logo.png" alt="logo"></a>
</div><div id="ots"><div id="content_full"><div id="lpanel"> <div class="topmenu">РЕЙТИНГИ</div><div class="menu_gl">';
if ($_SERVER['PHP_SELF'] == '/index.php') {
    echo '</div><div class="sub_cat">TOP 100</div><div class="menu_gl">';
    } else {
        echo '<a href="/">TOP 100</a>';
    }
		$count_vip_sites = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `vip` = '1'"));
if ($_GET['act'] == 'vip') {
    echo '</div><div class="sub_cat">VIP сайты ('.$count_vip_sites.')</div><div class="menu_gl">';
} else {
    echo '<a href = "http://'.$set['home'].'/m/category/vip">VIP сайты ('.$count_vip_sites.') <img src="/text/vip.png"></a>';
	}
	$count_new_sites = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `newsait` != '1' AND `category` != '6'"));
if ($_GET['act'] == 'new') {
    echo '</div><div class="sub_cat">Новые сайты ('.$count_new_sites.')</div><div class="menu_gl">';
} else {
    echo '<a href = "http://'.$set['home'].'/m/category/new">Новые сайты ('.$count_new_sites.')</a>'; 
}
	$count_ban_sites = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `ban` = '1'"));
	if ($_SERVER['PHP_SELF'] == '/m/ban.php') {
    echo '</div><div class="sub_cat">Заблокированные ('.$count_ban_sites.')</div><div class="menu_gl">';
} else {
echo '<a href = "http://'.$set['home'].'/m/ban">Заблокированные ('.$count_ban_sites.')</a>';
	}
	echo '</div>
<div class="topmenu">РУБРИКИ</div><div class="menu_gl">';
		$cats = mysql_query("SELECT * FROM `".$prefix."cat` ORDER BY `position`");
while($cat = mysql_fetch_array($cats))
			{
if ($cat['id'] == '6') {
$ero = '';
} else {
$ero = " AND  `newsait` = '1' AND `vip` != '1'";
}
$count_sites = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `category` = '".$cat['id']."' AND `status` = '1' AND `hosts` > '0'".$ero.""));
if ($_GET['act'] == 'view' AND $_GET['id'] == $cat['id']) {
    echo '</div><div class="sub_cat">'.$cat['name'].' ('.$count_sites.')</div><div class="menu_gl">';
} else {
    echo '<a href="http://'.$set['home'].'/m/category/view/'.$cat['id'].'">'.$cat['name'].' ('.$count_sites.')</a>';
		}
		}
		echo '</div><br /><br /><center>'.($user_data ? '<a href="/m/office/addPlatform">' : '<a href="/m/authentication">').'
<span style="background:#fff;background-size:auto;padding: 12px;padding-left:11%;padding-right:10%;">
<font color="black">Добавить сайт</font></span></a><br /><br />
<br>
</center>';
echo '</div><!-- lpanel --><div id="rpanel">';
echo '<div class="topmenu">Меню '.($user_data ? 'пользователя ' : 'гостья').'</div>';
if(!$user_data)

{

echo '<div class="main">
				<form action="/m/authentication" method="POST">
				Ваш логин:<br/>
				<input type="text" class="input" name="login" maxlength="30" value="" size="20" maxlength="50" /><br/>
				Ваш пароль:<br/>
				<input type="text" class="input" name="password" maxlength="30" value="" size="20" maxlength="50" /><br/>
				<input name="ok" type="submit" value="Войти" /><br/>
				</div></form><a class="link" href="/m/recoveryPassword">Забыли пароль?</a><a class="link" href="http://'.$set['home'].'/m/registration">Регистрация</a> ';
}

else

{
echo '<div class="stat" style="border-bottom: 1px dotted #eee;">Баланс: '.$user_data['balans'].' кр '.($user_data['balans'] > 400 ? '| <a href="/wk/user_rek.php">Купить рекламу 400 кр</a>' : '| Купить рекламу 400 кр').'</div>';
if($user_data['level'] == 2) echo '<a class="link" href="http://'.$set['home'].'/adm_panel/index.php">Админ-Панель</a>';

$platforms = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `id_user` = '".$user_data['id']."'"));

echo '<a class="link" href="http://'.$set['home'].'/m/office">Кабинет</a><a class="link" href="http://'.$set['home'].'/m/office/platforms">Мои сайты ['.$platforms.'/'.$set['max_platforms'].']</a><a class="link" href="http://'.$set['home'].'/exit">Выход</a>
';
}
echo '<div class="topmenu">Реклама:</div>';
include_once $_SERVER['DOCUMENT_ROOT'].'/wk/config.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/wk/advert.php';

echo '<div class="topmenu">Поиск сайтов</div><div class="main"><center><form action="/m/search.php" method="POST" name="form">
<input type="text" name="search" maxlenght="60" value=""/><input type="hidden" name="m" value="1"><input type="submit" name="go" value="Поиск">
</form></center></div>';
echo '<div class="topmenu">Счетчики</div><div class="stat" align="center">';
echo '<script type="text/javascript" src="http://keotop.ru/js/1.js"></script><noscript><a href="http://keotop.ru/go/1"><img src="http://keotop.ru/i/1.png" alt=""/></a></noscript>';
echo '<br /><!--cy-pr.com--><a href="http://www.cy-pr.com/" target="_blank"><img src="http://www.cy-pr.com/e/statok.net_5_107.138.206.gif" border="0" width="88" height="15" alt="Проверка тИЦ и PR" /></a><!--cy-pr.com--><script type="text/javascript" src="/m/live.js"></script>';
echo '</div>';
echo '</div><div id="cpanel"><div id="content_bg">';


$news = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."news`"));
$cat_all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."cat`"));
$plaforms_ban = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `ban` = '1'"));



$id_site = $_GET['id_site'];


$div_stat = '<div class="stat">';
$div_span = '<span style="background: #444;padding-bottom: 10px;padding-top: 10px;padding-left: 10px;padding-right: 10px;color:#fff;margin-right:10px;border-radius: 5px;">';

?>