Файл: head.php
Строк: 235
<?php
require 'lang_inc.php';
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
if (!empty($_SESSION['us']) && !empty($user['style_panel'])) {
if ($user['style_panel'] == '') {
$bg = 'b4c8e9';
$cl1 = '003a77';
$cl2 = '434e60';
$lk = '064a92';
}
if ($user['style_panel'] == '0066cc') {
$bg = '0066cc';
$cl = '9999ff';
$lk = 'ffffff';
}
if ($user['style_panel'] == '3b5998') {
$bg = '3b5998';
$cl = '9999ff';
$lk = 'ffffff';
}
if ($user['style_panel'] == '000000') {
$bg = '000000';
$cl = '666666';
$lk = 'ffffff';
}
if ($user['style_panel'] == '006600') {
$bg = '006600';
$cl = '009933';
$lk = 'fff';
}
if ($user['style_panel'] == '33cc66') {
$bg = '33cc66';
$cl = '009933';
$lk = '003300';
}
if ($user['style_panel'] == 'ffcccc') {
$bg = 'ffcccc';
$cl = 'cc9999';
$lk = '660000';
}
if ($user['style_panel'] == 'ffcc66') {
$bg = 'ffcc66';
$cl = '996633';
$lk = '663300;';
}
}
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>
<title>' . $otitle . '</title>
<link rel="shortcut icon" href="/favicon.ico"/>
<link rel="stylesheet" href="/styles/'.(isset($_SESSION['us']) ? $user['style'] : 'standart').'.css" type="text/css"/>
</head>
<body>';
$actPng = (isset($_SESSION['us'])) ? 'styles/img_' . $user['style'] . '/act' : '/styles/img_standart/act';
$logoHome = (isset($_SESSION['us'])) ? 'styles/img_' . $user['style'] . '/logo' : '/styles/img_standart/logo';
// Extra ЛВЛ, LVL
if ( isset( $user['id'] ) )
{
$extra_n = rand( 1, 100);
if ($extra_n == 1 or $extra_n == 20 or $extra_n == 80)
{
$extra_unic = rand( 1111111111, 9999999999 );
$_SESSION['unic_code'] = $extra_unic;
$_SESSION['is_str'] = $_SERVER['PHP_SELF'];
echo $div_title . '<b><a href="../extra_ball.php?unic_code=' . $extra_unic . '&lg='.$lg.'">'.$lang['Поймать ЛВЛ'].'!</a></b>' . $div_end;
}
}
/////
if (empty($_SESSION['us'])) {
echo "<a href="?lg=ru"><img src="../ico/_ru.png" alt="RU"/></a>nn";
echo "<a href="?lg=lv"><img src="../ico/_lv.png" alt="LV"/></a><br/>";}
/////
/////
if ($user['lang'] == '2'){
echo "<a href="?lg=ru"><img src="../ico/_ru.png" alt="RU"/></a>nn";
echo "<a href="?lg=lv"><img src="../ico/_lv.png" alt="LV"/></a><br/>";}
/////
$ref = mt_rand(10000, 1000000);
// Проверка куки, запись сессии
if (!empty($_COOKIE['us']) && empty($_SESSION['us'])) {
$_SESSION['us'] = check($_COOKIE['us']);
$_SESSION['ps'] = check($_COOKIE['ps']);
header('Location: ' . $_SERVER['REQUEST_URI'] .$lg);
}
// логотип
if (empty($_SESSION['us']) && $_SERVER['PHP_SELF'] == '/reg.php' || empty($_SESSION['us']) && $_SERVER['PHP_SELF'] == '/faq.php' || empty($_SESSION['us']) && $_SERVER['PHP_SELF'] == '/aut.php' || empty($_SESSION['us']) && $_SERVER['PHP_SELF'] == '/index.php' || !empty($_SESSION['us']) && $user['home_logo'] == 1 && $_SERVER['PHP_SELF'] == '/index.php') {
echo '<div style="text-align: center; margin: 2px;"><img src="ico/logo.png" alt="logo"/></div>';
}
// если рега на модерации
if (!empty($_SESSION['us']) && !empty($_COOKIE['us']) && $user['mod_reg'] == 1) {
echo $div_title . ''.$lang['Стоп'].'!' . $div_end . '
'.$lang['Внимание! Ваша анкета отправлена на модерацию, дождитесь её одобрения Администратором'].'.';
include_once $_SERVER['DOCUMENT_ROOT'] . '/foot.php';
exit();
}
// если не зареган
if (empty($_SESSION['us']) && empty($_COOKIE['us'])) {
echo ($_SERVER['PHP_SELF'] !== '/index.php?lg='.$lg.'' && $_SERVER['PHP_SELF'] !== '/reg.php?lg='.$lg.'' && $_SERVER['PHP_SELF'] !== '/aut.php?lg='.$lg.'')
? $div_razdel . '<a href="/aut.php?lg='.$lg.'&'.$ref.'">'.$lang['Вход'].'</a> | <a href="/reg.php?lg='.$lg.'&'.$ref.'">'.$lang['Регистрация'].'</a> | <a href="/faq.php?lg='.$lg.'&do=guid">'.$lang['Путеводитель'].'</a>' . $div_end
: '';
}
// проверка авторизации
if (!empty($_SESSION['us']) && !empty($_SESSION['ps']) && isset($user)) {
// вывод новых писем
$count_letter = mysql_result(mysql_query("SELECT COUNT(*) FROM `letters` WHERE `idwho` = '$user[id]' AND `read` = '0'"), 0);
if (!empty($count_letter)) $new_num_let = '<span style="color: #FF0000;">+' . $count_letter . '</span>';
$whyicon = ($count_letter != 0) ? '<img src="/ico/icon_pochta2.gif" alt=""/>' : '<img src="/ico/icon_pochta.gif" alt=""/>';
// вывод новых событий в ленте
$count_lenta = mysql_result(mysql_query("SELECT COUNT(*) FROM `lenta` WHERE `user` = '$user[id]' AND `read` = '1'"), 0);
if (!empty($count_lenta)) $new_num_len = '<span style="color: #FF0000;">+' . $count_lenta . '</span>';
// новых заявок в друзья
$new_fr = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `who` = '$user[id]' AND `zajavka` = '0'"), 0);
if (!empty($new_fr))
{
$iconFr = ($user['menu_icon'] == 0) ? ''.$lang['Заявки'].'' : '<img src="/ico/druzya.gif" alt=""/>';
$new_friend = '<a href="/friends.php?do=invites&lg='.$lg.'"> ' . $iconFr . '<span style="color: #FF0000;">+' . $new_fr . '</span> </a>|';
}
$NewOko = mysql_result(mysql_query("SELECT COUNT(*) FROM `oko` WHERE `user` = '$user[id]' AND `look` = '1' AND `time` + 180 > '" . time() . "'"), 0);
if (!empty($NewOko))
{
$iconOko = ($user['menu_icon'] == 0) ? 'Око' : '<img src="/ico/oko.gif" alt=""/>';
$OkoNew = '<a href="/oko.php?lg='.$lg.'&'.$ref.'"> ' . $iconOko . '<span style="color: #FF0000;">+' . $NewOko . '</span> </a>|';
}
// вывод ссылки "главная" на др.страницах, кроме главной
$iconGl = ($user['menu_icon'] == 0) ? ''.$lang['Главная'].'' : '<img src="/ico/icon_glavnaya.gif" alt=""/>';
$_home = ($_SERVER['PHP_SELF'] !== '/index.php?lg='.$lg.'')
? '<a href="/index.php?lg='.$lg.'&'.$ref.'"> ' . $iconGl . ' </a>|'
: '';
$WhyDiv = (empty($user['style_panel'])) ? $div_menu_i : $div_navi;
// постраничка вверху
$iconLt = ($user['menu_icon'] == 0) ? ''.$lang['Почта'].'' : $whyicon;
$iconPg = ($user['menu_icon'] == 0) ? ''.$lang['Моя стр'].'' : '<img src="/ico/icon_stranica.gif" alt=""/>';
$iconLe = ($user['menu_icon'] == 0) ? ''.$lang['Лента'].'' : '<img src="/ico/icon_lenta.gif" alt=""/>';
$iconRe = ($user['menu_icon'] == 0) ? ''.$lang['Обновить'].'' : '<img src="/ico/icon_obnovit.gif" alt=""/>';
echo $WhyDiv . $div_left . $_home . '<a href="/'.$user['id'].'?lg='.$lg.'"> ' . $iconPg . ' </a>|<a href="/mail.php?lg='.$lg.'&'.$ref.'"> ' . $iconLt . $new_num_let . ' </a>|<a href="/lenta.php?lg='.$lg.'&'.$ref.'"> ' . $iconLe . $new_num_len . ' </a>|' . $new_friend . $OkoNew . '<a href="'.$_SERVER['REQUEST_URI'].'"> ' . $iconRe . ' </a>' . $div_end . $div_end;
// если в игре
$battle = mysql_query("SELECT `id`, `user`, `who` FROM `strike`
WHERE `user` = '$user[id]'
OR `who` = '$user[id]'
AND `set` = '0'
LIMIT 1");
if (mysql_num_rows($battle) != FALSE && $_SERVER['PHP_SELF'] !== '/games/strike.php?lg='.$lg.'') {
$in_battle = mysql_fetch_array($battle);
msg(''.$lang['Вы находитесь в бою'].'!');
echo '<a href="/games/strike.php?do=battle&b='.$in_battle[0].'&lg='.$lg.'">'.$lang['Противостояние'].'</a>';
}
// если приглашают в игру
$battle = mysql_query("SELECT `id`, `user`, `who` FROM `strike`
WHERE `who` = '$user[id]'
AND `set` = '1'
LIMIT 1");
if (mysql_num_rows($battle) != FALSE && $_SERVER['PHP_SELF'] !== '/games/strike.php?lg='.$lg.'&') {
$in_battle = mysql_fetch_array($battle);
msg(''.$lang['Вас вызывают на поединок в игру "Противостояние". Вы согласны'].'?');
echo '<span class="next"><img src = "/ico/ok.gif" alt = ""/>
<a href="/games/strike.php?do=yes&b='.$in_battle[0].'&lg='.$lg.'">'.$lang['Да'].'</a></span>
<span class="next"><img src = "/ico/delete.gif" alt = ""/>
<a href="/games/strike.php?do=no&b='.$in_battle[0].'&lg='.$lg.'">'.$lang['Нет'].'</a></span>';
}
// вывод именинников
$birthday = mysql_query("SELECT DISTINCT friends.who FROM friends WHERE user = '$user[id]' AND zajavka = '1' AND who IN(SELECT id FROM users WHERE birth LIKE '" . date('j.n.') . "%')");
if (mysql_num_rows($birthday) != FALSE && $_SERVER['PHP_SELF'] !== '/birthday.php?lg='.$lg.'') {
echo $div_left . '<a href="/birthday.php?lg='.$lg.'&'.$ref.'">'.$lang['Дни рождения сегодня'].'(' . mysql_num_rows($birthday) . ')</a>' . $div_end;
}
// если заблокирован ник
if (!empty($user['kik']) && $user['kik'] > time()) {
echo $div_title . ''.$lang['Стоп'].'!' . $div_end;
$WHO = (empty($user['whokik'])) ? ''.$lang['Системой'].'' : ''.$lang['Администратором'].' ' . user_inf($user['whokik'], 'user') . '';
err(''.$lang['Вы были заблокированы'].' ' . $WHO . ' '.$lang['за'].': ' . $user['whykik'] . '<br/>
'.$lang['До окончания блокировки осталось'].': ' . kikt($user['kik']));
include_once $_SERVER['DOCUMENT_ROOT'] . '/foot.php';
exit();
} elseif (!empty($user['kik']) && $user['kik'] < time()) {
mysql_query("UPDATE `users` SET `whykik` = '', `whokik` = '', `kik` = '' WHERE `id` = '$user[id]' LIMIT 1");
}
// если заблокирован ip
$ban = mysql_query("SELECT `ip` FROM `bannlist` WHERE `who` = '$user[id]' LIMIT 1");
$from = mysql_fetch_array($ban);
$Ip = substr($from[0], 0, 8);
if (mysql_num_rows($ban) != 0 && preg_match("/$Ip([.0-9]+)/", $ipp)) {
echo $div_title . ''.$lang['Стоп'].'!' . $div_end;
err(''.$lang['Ваш IP заблокирован'].'!');
include_once $_SERVER['DOCUMENT_ROOT'] . '/foot.php';
exit();
}
}
?>