Размер файла: 4.38Kb
<?php
if ($user)
{
if ($user['style']==0)
{
$theme='/style/style.css';
$wtheme='/style/web.css';
}
else
{
$theme='/style.css';
$wtheme='/web.css';
}
}
else
{
$theme='/style.css';
$wtheme='/web.css';
}
$sps=$_SERVER['PHP_SELF'];
$browser=htmlspecialchars($_SERVER['HTTP_USER_AGENT']);
$web=0;
if (preg_match("/windows/i", $browser))$web=1;
if ($_COOKIE['web']=='1')$web=1;
elseif ($_COOKIE['web']=='0')$web=0;
$a=mysql_num_rows(mysql_query("SELECT `id` FROM `mail` WHERE `to` = '$user[id]' AND `read` = '0'"));
$newm=$a;
$p=mysql_num_rows(mysql_query("SELECT `id` FROM `jurnal` WHERE `user` = '$user[id]' AND `read` = '0'"));
$newj=$p;
$l=mysql_num_rows(mysql_query("SELECT `id` FROM `lenta` WHERE `user` = '$user[id]' AND `read` = '0'"));
$newl=$l;
$x=mysql_num_rows(mysql_query("SELECT `id` FROM `friends` WHERE (`user1` = '$user[id]' OR `user2` = '$user[id]') AND `ok` = '0' AND `who` <> '$user[id]'"));
$newf=$x;
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD HTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html lang="ru">
<head>
<meta http-equiv="content-Type" content="text/html; charset=UTF-8">
<title><?=$title?></title>
<link rel="shortcut icon" href="/favicon.ico">
<?php
if ($web==0)echo '<link rel="stylesheet" href="'.$theme.'" type="text/css">';
else
echo '<link rel="stylesheet" href="'.$wtheme.'" type="text/css">';
?>
</head>
<body>
<?php
if ($web==0){
echo '<div class="title">';
echo '<b>'.strtoupper($_SERVER['HTTP_HOST']).'</b>';
echo '</div>';
}
else
{
echo '<table width="100%" CELLSPACING="0"><tr><td colspan="3">';
echo '<div class="title" align="center">';
//echo "<font size='+2'><center><b>".strtoupper($_SERVER['HTTP_HOST'])." <u>[QCMS]</u></b></center></font>";
echo '<img src=\'http://'.$_SERVER['HTTP_HOST'].'/logo.gif\'>';
echo '</div>';
echo '<center>';
if (!$user)echo '<div class="user" align="center" style="color:white;font-size:16px"><b>Войдите или зарегистрируйтесь!</b></div>';
else
{
echo '<div class="user" align="center">';
if ($sps!='/index.php')echo '<a href="/index.php">Главная</a> - ';
echo '<a href="/kont.php">Почта</a> - <a href="/forum.php">Форум</a> - <a href="/chat.php">Чат</a> - <a href="/vote.php">Опросы</a> - <a href="/obmen.php">Обменник</a> - <a href="/guestbook.php">Беседка</a></div>';
}
if ($user && ($user['news']==0))echo '<div class=\'user\'><a href=\'/news.php\'>Новости (!)</a></div>';
if (!$user)echo '<div class="user"><a href="index.php">Домой</a> <a href="aut.php">Вход</a> <a href="reg.php">Регистрация</a></div>';
if ($sps=='/index.php')echo rekl('1');
else echo rekl('2');
echo '</center></td></tr>';
}
?>
<div class="index">
<?php
if ($web==0){
if ($_SERVER['PHP_SELF']!='/index.php')echo rekl('2');
if (!$user && ($_SERVER['PHP_SELF']!='/index.php'))echo "<div class='user'><a href='aut.php'>Вход</a> <a href='reg.php'>Регистрация</a></div>";
if (!$user)echo '<div class="user" style="color:white"><b>Войдите или зарегистрируйтесь!</b></div>';
else echo '<div class="user"><a href="/index.php">Дом</a> <a href="/kab.php">Каб</a> <a href="/kont.php">Поч</a> <a href="/forum.php">Фор</a> <a href="/chat.php">Чат</a></div>';
if ($p && $user)echo '<div class="user"><a href="/jurnal.php">Журнал (+'.$p.')</a></div>';
if ($a && $user)echo '<div class="user"><a href="/mailn.php">Почта (+'.$a.')</a></div>';
if ($l && $user)echo '<div class="user"><a href="/lenta.php">Лента (+'.$l.')</a></div>';
if (($x!=0) && $user)echo '<div class="user"><a href="/friends_new.php">Друзья (+'.$x.')</a></div>';
if ($user && ($user['news']==0))echo '<div class="user"><a href="/news.php">Новости (!)</a></div>';
}
else
{
if ($user)echo '<tr><td width=\'100\' valign=\'top\'>';
else
echo '<tr><td width="150" valign="top"><div class="left">';
include 'right.menu.php';
echo '</div></td><div class="right1"><td class="qwerty" width="400" valign="top" style="margin-left:11px">';
}
if ($web==0){
if ($sps=='/index.php')echo rekl('1');
}
$a=(($sps=='/index.php') || ($sps=='/aut.php') || ($sps=='/reg.php'));
$gis111=(time()-(date("G")*3600)-(date("i")*60)-date("S"));
if ($user)mysql_query("UPDATE `user` SET `click` = '".time()."' WHERE `id` = '$user[id]'");
mysql_query("DELETE FROM `guests` WHERE `time` < '$gis111'");
?>