Файл: head.php
Строк: 318
<?php
date_default_timezone_set('Europe/Kiev');
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" xml:lang="ru">
<head>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="/style/def.css" type="text/css"/>
<title>'.$title.'</title>
</head>
<body>';
if ($u['id']) {
$j = mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal` WHERE `user` = '" . $u['id'] . "' and `new` = '1'"), 0);
if ($j)
$j = '' . $j . ''; else
$j = '';
if ($u['count_mail'])
$mn = '' . $u['count_mail'] . ''; else
$mn = '';
$count_spam = mysql_result(mysql_query("SELECT COUNT(*) FROM `spam`"), 0);
if ($_SERVER['PHP_SELF'] != '/index.html') {
echo "<div class=title_logo><a href=/><img src='/style/title1.png'></a> <span class='right top_user_links service_links_block'style='margin-top:7px;float:right;'> <a href='/id".$u['id']."'>" . ico($u['sex'], $u['admin'], $u['online']) ." <font color=#79358c><b> ".$u['login']." </b></a></font></span></div>";
if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match('#up-browser|blackberry|windows ce|symbian|palm|nokia#i', $_SERVER["HTTP_USER_AGENT"]))
$webbrowser=false;
elseif (isset($_SERVER["HTTP_USER_AGENT"]) && (preg_match('#windows#i', $_SERVER["HTTP_USER_AGENT"]) ||preg_match('#linux#i', $_SERVER["HTTP_USER_AGENT"]) ||preg_match('#bsd#i', $_SERVER["HTTP_USER_AGENT"]) ||preg_match('#x11#i', $_SERVER["HTTP_USER_AGENT"]) ||preg_match('#unix#i', $_SERVER["HTTP_USER_AGENT"]) ||preg_match('#macos#i', $_SERVER["HTTP_USER_AGENT"]) ||preg_match('#macintosh#i', $_SERVER["HTTP_USER_AGENT"])))
$webbrowser=true;else $webbrowser=false; // определение типа браузера
if ($webbrowser == true)
{
$web_panel = true;
} else $web_panel = false;
$color = array();
$color['newevent'] = '#'.$u['panel_newevent'];
$color['fon'] = '#'.$u['panel_fon'];
$color['link'] = '#'.$u['panel_link'];
$color['focus_fon'] = '#'.$u['panel_focus_fon'];
$color['focus_link'] = '#'.$u['panel_focus_link'];
$color['border'] = '#'.$u['panel_border'];
$panel = array();
$panel['font_size'] = $u['panel_font_size'];
if ($u['panel']==1) {
$panel['home']="<img class='icon' src='/style/panel/home_".$u['panel_icons_list'].($web_panel==false?"_16x16":NULL).".png' alt='Старт'>";
$panel['mail']="<img class='icon' src='/style/panel/mail_".$u['panel_icons_list'].($web_panel==false?"_16x16":NULL).".png' alt='Почта'>";
$panel['journal']="<img class='icon' src='/style/panel/journal_".$u['panel_icons_list'].($web_panel==false?"_16x16":NULL).".png' alt='Журнал'>";
$panel['lenta']="<img class='icon' src='/style/panel/lenta_".$u['panel_icons_list'].($web_panel==false?"_16x16":NULL).".png' alt='Лента'>";
} elseif ($u['panel']==2) {
$panel['home']='Я';
$panel['mail']='Почта';
$panel['journal']='Жур';
$panel['lenta']='Лента';
} else {
$panel['home']='С';
$panel['mail']='Пч';
$panel['journal']='Ж';
$panel['lenta']='Л';
}
?>
<style>
a.top_menu_link {
text-align: center;
display: block;
padding: 3px;
}
tbody {
display: table-row-group;
vertical-align: middle;
border-color: inherit;
}
table {
border-collapse: separate;
border-spacing: 2px;
border-color: gray;
}
#navi {
color: <? echo $color['border'];?>;
font-size: <? echo $panel['font_size'];?>;
padding:4px 2px;
background-color:<? echo $color['fon'];?>;
border:1px solid #abbefb;
}
#navi a:link,#navi a:visited {
color:<? echo $color['link'];?>;
text-decoration:none;
font-size: <? echo $panel['font_size'];?>;
}
#navi a:focus,#navi a:hover,#navi a:active {
color:<? echo $color['focus_link'];?>;
background-color:<? echo $color['focus_fon'];?>;
}
#time {
background-color:#ccc;
color:#000;
font-size:medium;
text-align:right;
padding:0px 10px 0px 0px;
}
.newevent {
color:<? echo $color['newevent'];?>;
font-size: <? echo $panel['font_size'];?>;
vertical-align:bottom;
}
</style>
<div id="navi" >
<table style="width:100%" cellspacing="0" cellpadding="0"><tr>
<td style="vertical-align:top;width:24%;border-right:solid; border-width:1px">
<a class="top_menu_link user_color_link" href="/start.php"title="Старт">
<? echo $panel['home'];?>
</a>
</td>
<td style="vertical-align:top;width:25%;border-right:solid;border-width:1px;">
<a class="top_menu_link user_color_link" href="/mail.php" title="Почта">
<? echo $panel['mail'];?>
<? echo "<span class='newevent'>$mn</span>n";?>
</a>
</td>
<td style="vertical-align:top;width:25%;border-right:solid;border-width:1px;">
<a class="top_menu_link user_color_link" href="/jurnal.php" title="Журнал">
<? echo $panel['journal'];?>
<? echo "<span class='newevent'>$j</span>n";?>
</a>
</td>
<td style="vertical-align:top;width:24%;border-right:solid;border-width:0px;">
<a class="top_menu_link user_color_link" href="/lenta.php" title="Лента">
<? echo $panel['lenta'];?>
</a>
</td>
</tr></table>
</div>
<?
echo '<div class=login><center><a href ="/login.php?out=1">Выход с аккаунта</a></center> </a></div>';
if($u['id'] == 1) {
echo '<div class=login><a href ="http://unserhof.ru/adminka.php?act=sistem">Информация</a> </a>';
echo '<span style="float:right;"><a href ="/adminka.php">Админ-панель</span></a>';
echo '</div>';
}
//-------------------------------Жалобы + Журнал-------------------------------//
if ($count_spam) {
if ($u['admin'] == 1 || $u['admin'] == 2) {
echo '<div class="nav">';
echo ' <a href = "/adminka.php?act=spam">Жалобы</font> <b>+' . $count_spam . '</b></a>';
echo '</div>';
}
}
}
//------------------------Скрываем дневник админа---------------------//
if (isset($_GET['closes'])) {
mysql_query("UPDATE `users` SET `news` = '0' WHERE `id` = '" . $u['id'] . "' ");
header('location: /diary.php?close=ok');
}
if (isset($_GET['close'])) {
echo '<div class="ok"><center>
Уведомление скрыто!
</center></div>';
}
//------------------------Дневник админа---------------------//
$res = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "'"));
$news = $res['news'];
if ($news == 1) {
$result = mysql_query("SELECT * FROM `diary_messages` WHERE `user` = '1' ORDER BY `time` DESC LIMIT 1");
while ($diary = mysql_fetch_assoc($result)) {
$msg = checkout($diary['name']);
$id = num($diary['id']);
echo '<div class="title">';
echo '<b>' . $msg . '</b>';
echo '<span style="float:right;"><a href="?closes"><font color="green">(Скрыть)</font></a></span>';
echo '<br /><a href="/diary.php?act=message&id=' . $id . '&link=1" title="Читать"><u>Подробнее</u> →</a>';
echo '</div>';
}
}
} else {
//-------------------------------Панель - закрываем на главной + Видят неавторезированые-------------------------------//
if ($_SERVER['PHP_SELF'] != '/index.html') {
echo "<div class=title_logo><center><a href=/><img src='/style/title1.png'></a></center></div>";
echo '<div class="title_head"><a href="/about.php?"><font
color=white>Инструкция</font></a></div>';
echo "<div class=login><center><a href='/login.php'>Авторизация</a><a href='/reg.php'>Регистрация</a></center></div>";
}
//-------------------------------Конец панельки-------------------------------//
}
//-------------------------------Дуэли-------------------------------//
@$duels_end = mysql_result(mysql_query("SELECT COUNT(*) FROM `duels_list` WHERE `time_end` < '" . time() . "'"), 0);
if ($duels_end > 0) {
$result = mysql_query("SELECT * FROM `duels_list` WHERE `time_end` < '" . time() . "'");
while ($duel = mysql_fetch_assoc($result)) {
$count1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `duels_votes` WHERE `vote` = '1' AND `duel` = '" . $duel['id'] . "'"), 0);
$count2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `duels_votes` WHERE `vote` = '2' AND `duel` = '" . $duel['id'] . "'"), 0);
if ($count1 == $count2)
$victory = 0;
else if ($count1 > $count2)
$victory = $duel['user1'];
else
$victory = $duel['user2'];
mysql_query("UPDATE `duels_list` SET `victory` = '$victory' WHERE `id` = '" . $duel['id'] . "'");
}
}
//-------------------------------Локации-------------------------------//
@mysql_query("UPDATE `users` SET `online` = '" . time() . "', `location` = '$location', `chat_location` = '$chat_location' WHERE `id` = '" . $u['id'] . "'");
//-------------------------------Фиксируем день рождение-------------------------------//
$ank_date = $u['anketa_bday'] + $u['anketa_bmonth'];
$real_date = date("n") + date("j");
if ($ank_date == $real_date) {
@mysql_query("UPDATE `users` SET `cake` = '1' WHERE `id` = '" . $u['id'] . "'");
} else {
@mysql_query("UPDATE `users` SET `cake` = '0' WHERE `id` = '" . $u['id'] . "'");
}
//-------------------------------Подсчёт онлайн-времени-------------------------------//
if (@$u['online']) {
$timeplus = time() - $u['online'];
if ($timeplus < $system['online_time']) {
mysql_query("UPDATE `users` SET `anketa_alltime` = '" . ($u['anketa_alltime'] + $timeplus) . "' WHERE `id` = '" . $u['id'] . "'");
} else {
mysql_query("UPDATE `users` SET `anketa_alltime` = '" . ($u['anketa_alltime'] + $system['online_time']) . "' WHERE `id` = '" . $u['id'] . "'");
}
}
//-------------------------------Проверка на блок (заморозка)-------------------------------//
if ($u['delete'] == 1) {
ok(' Аккаунт ' . $u['login'] . ' заблокирован за нарушение </font><a href="/rules.php">условий использования сервиса</a> ');
require('foot.php');
exit;
}
if (isset($u['id']) && empty($page_page)) {
if (ban($u['id'])) {
$bans = mysql_fetch_assoc(mysql_query("SELECT * FROM `users_ban` WHERE `user` = '" . $u['id'] . "' ORDER BY `time` DESC"));
ok(' Вы были заблокированы за нарушение <a href="/rules.php">условий использования сервиса</a> </br>
До окончания блокировки осталось: ' . kikt($bans['time_ban']) . ' ');
require('foot.php');
exit;
}
}
//-------------------------------Проверка на бан-------------------------------//
if (ban($u['id']) == 1) {
$bans = mysql_fetch_assoc(mysql_query("SELECT * FROM `users_ban` WHERE `user` = '" . $u['id'] . "' ORDER BY `time` DESC"));
echo '<div class="div">';
echo '<font color="green">Вы были заблокированы за нарушение <a href="/rules.php">условий использования сервиса</a></font> </br>';
echo '<font color="green">До окончания блокировки осталось:</font> <font color="red">' . kikt($bans['time_ban']) . '</font>';
echo '<br />';
echo '<font color="green">Заблокировал: ' . ico($bans['sex'], $bans['admin'], $bans['online']) . ' </font><a href = "page.php?id=' . $bans['admin'] . '"><b><font color="#79358c">' . login($bans['admin']) . '</font></b></a></br>';
if ($bans['time_ban'] > time()) {
echo '<span style="color:green;">Время бана истекает: </span> ' . vremya($bans['time_ban']) . '<br/>';
}
echo '</div>';
include ('foot.php');
exit;
}
?>