View file inc/1.php

File size: 3.8Kb
<?php
$sps=$_SERVER['PHP_SELF'];
$browser=htmlspecialchars($_SERVER['HTTP_USER_AGENT']);
$web=0;
if (preg_match("/Opera Mini/i", $browser))$opera=1;
if (preg_match("/windows/i", $browser))$web=1;
if ($_COOKIE['web']=='1')$web=1;
elseif ($_COOKIE['web']=='0')$web=0;
if ($opera==1)$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;
?>
<!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="/style.css" type="text/css">';
else
echo '<link rel="stylesheet" href="/web.css" type="text/css">';
?>
</head>
<body>
<?php
if ($web==0){
echo '<div class="title">';
echo strtoupper($_SERVER['HTTP_HOST']);
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:navy;font-size:16px"><b>Войдите или зарегистрируйтесь!</b></div>';
if ($user)echo '<div class="user" align="center"><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> - <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\'>Новости (+1)</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');
if ($sps!='/index.php')echo rekl('2');
echo '</center>';
echo '</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:navy"><b>Войдите или зарегистрируйтесь!</b></div>';
if ($user)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 ($user && ($user['news']==0))echo '<div class="user"><a href="/news.php">Новости (+1)</a></div>';
}
else
{
if ($user)echo '<tr><td width=\'100\' valign=\'top\'>';
else
echo '<tr><td width="150" valign="top">';
include 'right.menu.php';
echo '</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');
//if ($sps!='/index.php')echo rekl('2');
}
$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'");
?>