|
<?php
echo '<!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" xml:lang="ru">
<head>
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="format-detection" content="telephone=no"/>
<link rel="shortcut icon" href="'.HOME.'/design/theme/'.$styling.'/favicon.png">';
$tgens = microtime(1);
echo '<link rel="stylesheet" href="'.HOME.'/design/theme/'.$styling.'/style.css" type="text/css" /> ';
if ($_SERVER['PHP_SELF'] == '/index.php')
$title = $settings['title'];
echo ' <title>'.$title.'</title>
</head>
<body>';
if (isset($user['id']))
{
$db->query("UPDATE `users` SET `viz`='".TIME."', `ip`='".$IP."',`browser`='".$UA."',`gde`='".$title." , ".strong($_SERVER['REQUEST_URI'])."' WHERE `id`='".$user['id']."'");
} else
{
$user = null;
##Вычисляем гостей
$guest = $db->super_query("SELECT * FROM `online_guests` WHERE `g_id` = '".md5($IP.$UA)."' LIMIT 1");
if ($guest)
{
$db->query("UPDATE `online_guests` SET `time` = '".TIME."', `gde`='".$title." , ".strong($_SERVER['REQUEST_URI'])."' WHERE `g_id` = '".md5($IP.$UA)."'");
} else
{
$ref = null;
$db->query("INSERT INTO `online_guests` SET `g_id` = '".md5($IP.$UA)."', `ip` = '".$IP."', `browser` = '".$UA."', `gde`='".$title." , ".strong($_SERVER['REQUEST_URI'])."', `time` = '".TIME."', `REFERER` = '".strong($ref)."'");
}
}
echo '<div class="logo"><img src="'.HOME.'/design/theme/'.$styling.'/logo.png" alt="logotip">';
if ($user['id']) echo '<span class = "men"><a href="'.HOME.'/user/cab.php" title="Кабинет"><img src="'.HOME.'/design/theme/'.$styling.'/menu/info.png" alt=""/></a></span>';
echo '</div>';
if (!$user['id'])
{
echo '<div class="auth" ><a href="/login.php"><center>Авторизация</center></a> ';
echo '<a href="/registr.php"><center>Регистрация</center></a></div>';
}
if ($user['id'])
{
$len = $db->super_query("SELECT COUNT(*) as count FROM `lenta` WHERE `komy` = '".$user['id']."' and `readlen` = '0'");
$mes = $db->super_query("SELECT COUNT(*) as count FROM `message` WHERE `komy` = '".$user['id']."' and `readlen` = '0'");
$load_mod = $db->super_query("SELECT COUNT(*) as count FROM `load_file` WHERE `mod` = '0'");
echo '<div class="auth" >';
echo '<a href="'.HOME.'/lenta"><center>Лента<font color="red"><b>'.($len['count'] > 0 ? ' +'.$len['count'].'' : '').'</b></font></center></a> ';
echo '<a href="'.HOME.'/mes"><center>Сообщения<font color="red"><b> '.($mes['count'] > 0 ? ' +'.$mes['count'].'' : '').' </b></font> </center></a>';
echo '</div>';
}
$rek = $db->super_query("SELECT COUNT(*) as count FROM `ads` WHERE `time_srok` > '".TIME."' and `tip` = '0'");
##Блок рекламы
if ($rek['count'] != 0)
{
echo '<div class="news">';
$sql_rek = $db->query("SELECT * FROM `ads` WHERE `time_srok` > '".TIME."' and `tip` = '0' ORDER BY rand() ");
while ($sql = $db->fetch_assoc($sql_rek))
{
echo '<a href="'.$sql['url'].'"><img src="'.HOME.'/images/rr.png" /> ';
echo '<font color="'.$sql['color'].'">';
if ($sql['b'] == 1)
echo '<b>';
if ($sql['i'] == 1)
echo '<i>';
echo $sql['name'];
if ($sql['i'] == 1)
echo '</i>';
if ($sql['b'] == 1)
echo '</b>';
echo '</font>';
echo '</a>';
if ($rek > 1)
echo '
';
}
echo '</div>';
}
if ($user['level'] >= 1)
echo ' '.($load_mod['count'] > 0 ? '<a href="'.HOME.'/panel/load_mod" class="menudiv">Модерация файлов <font color="red"><b>+'.$load_mod['count'].'</b></font></a>' : '').' ';
?>