Файл: system/view/header.php
Строк: 187
<?
$azazaza = $db->query("SELECT `id`,`gold`,`gtime` FROM `forum_t` WHERE `gold` = '1'")->fetch();
if ($azazaza['gtime'] < time ())
{
$db->query("UPDATE `forum_t` SET `gold` = '0' WHERE `id` = '". $azazaza['id'] ."'");
}
if(isset($user))
{
if(!isset($locate))
{
$locate = 'in_site';
}
$db->query("UPDATE `users` SET `locate` = '". $locate ."' WHERE `id` = '". $user['id'] ."'");
}
if(!file_get_contents(TPL.'/themes/'.$tpl->type.'/'. $stylen .'/header'. $tpl->format)) {
?>
<!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" lang="ru" xml:lang="ru">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?=''.(!empty($title) ? ''.$title.'' : 'Page of PerfCMS').''; ?> | <?=$system['title'];?></title>
<link rel="stylesheet" href="/template/themes/<?=$ttype; ?>/<?=$stylen; ?>/style.css" type="text/css"/>
<link rel="stylesheet" href="/template/themes/<?=$ttype; ?>/<?=$stylen; ?>/style1.css" type="text/css"/>
<?php echo (!empty($system['description']) ? '<meta name="description" content="'.$system['description'].'" />' : NULL); ?>
<?php if(!empty($system['keywords'])) { ?>
<meta name="keywords" content="<?=$system['keywords']; ?>" /> <? } ?>
</head>
<body>
<?echo '<div class="logo"><a href="/"><img style="margin:0; padding:0;max-width:100%;height:73px" src="/template/themes/wap/default/images/logo.png" alt="logo"></a></div>';
?>
<? if(isset($user)) {
$new_mess = $db->query("SELECT * FROM `mail` WHERE `who_id` = '". $user['id'] ."' AND `read` = '0'")->rowCount();
$new_notify = $db->query("SELECT * FROM `notify` WHERE `user_id` = '". $user['id'] ."' AND `read` = '0'")->rowCount();
echo '<table width="100%" cellspacing="0" cellpadding="0" class="auts">
<tr>
<td class="aut"><a href="/user/panel/" title="'.$user['nick'].'"><center><div id="darks" class="icon-user2"></div></a></center></td>
<td class="aut"><a href="/mail/" title="Почта"><center><div id="darks" class="icon-mail2"></div>'.($new_mess>0 ? '<font color="white">+<b>'.$new_mess.'</b></font>' : NULL).'</a></center></td>
<td class="aut"><a href="/user/notify" title="События"><center><div id="darks" class="icon-bullhorn"></div>'.($new_notify>0 ? '<font color="white">+<b>'.$new_notify.'</b></font>' : NULL).'
</a></center></td>';
if($user['level'] >= 6) {
echo '<td class="aut"><a href="/padmin/" title="Админ-панель"><center><div id="darks" class="icon-settings"></div></a></center></td>';
}
echo '<td class="aut"><a href="/exit" title="Выход"><center><div id="darks" class="icon-exit"></div>
</a></center></td>
</tr>
</table>';
echo '<div class="title"><span style="float:left;">WAP Мастерская</span><span style="float:right;">MoSTOP.NeT</span></div>';
}
else {
echo '<table width="100%" cellspacing="0" cellpadding="0" class="auts">
<tr>
<td class="aut"><a href="/sign_in/" title="Авторизация"><center><div id="darks" class="icon-key2"></div></a></center></td>
<td class="aut"><a href="/sign_up/" title="Регистрация"><center><div id="darks" class="icon-lock"></div></a></center></td>
</tr>
</table>';
echo '<div class="title"><span style="float:left;">WAP Мастерская</span><span style="float:right;">MoSTOP.NeT</span></div>';
}
}
elseif(file_exists(TPL.'/themes/'.$tpl->type.'/'. $stylen .'/header'. $tpl->format)) {
$tpl->set_value('title', title(). ' | '.$system['title']);
$tpl->set_value('keywords', $system['keywords']);
$tpl->set_value('description', $system['description']);
$tpl->set_value('user-panel', user_panel());
$tpl->set_value('type', $tpl->type);
$tpl->set_value('theme', $stylen);
$tpl->set_value('user-id', $user['id']);
$tpl->set_value('nick', tnick($user['id']));
$tpl->parse('header');
$tpl->view();
}
$new_friends = $db->query("SELECT * FROM `friends` WHERE `friend_id` = '". $user['id'] ."' AND `active` = '0'")->rowCount();
if($new_friends > 0)
{
$tpl->div('menu', img('new_friend.png') .'<a href="/friends/requests">'. $lang->word('friends') .'</a> [+'.$new_friends.']');
}
echo $stat->adsHeader();
###Уведомления о состоянии сайта
if($system['open_site'] == 'no' && $page != 'auth' && $user['level'] < 6) {
$tpl->div('menu', $lang->word('site_closed'));
require_once(SYS.'/view/footer.php');
exit;
}elseif(time()<$user['ban_time']) {
$tpl->div('title', $lang->word('u_r_banned'));
$tpl->div('menu', $lang->word('ban_text').': '.$user['ban_text'].'<br/>
'.$lang->word('end_ban').': '.rtime($user['ban_time']).'');
require_once(SYS.'/view/footer.php');
exit;
}elseif($system['open_mini_chat'] == 'no' && $user['level'] < 6 && $locate=='in_mini_chat') {
$tpl->div('menu', $lang->word('mini_chat_closed'));
require_once(SYS.'/view/footer.php');
exit;
}elseif($system['open_forum'] == 'no' && $user['level'] < 6 && $locate=='in_forum') {
$tpl->div('menu', $lang->word('forum_closed'));
require_once(SYS.'/view/footer.php');
exit;
}elseif($system['open_share'] == 'no' && $user['level'] < 6 && $locate=='in_share') {
$tpl->div('menu', $lang->word('share_closed'));
require_once(SYS.'/view/footer.php');
exit;
}elseif($system['open_news'] == 'no' && $user['level'] < 6 && $locate=='in_news') {
$tpl->div('menu', $lang->word('news_closed'));
require_once(SYS.'/view/footer.php');
exit;
}elseif($locate=='in_portfolio') {
}elseif($locate=='in_index') {
}elseif($system['public_site'] == 'no' && !isset($user) && $page != 'reg') {
$tpl->div('title', $lang->word('sign_in'));
echo '<div class="menu">
<form action="/sign_in/?" method="post">
'. $lang->word('nick') .':<br/>
<input type="text" name="nick" /><br/>
'. $lang->word('password') .': [<a href="/user/recovery">'.$lang->word('recovery_pass1').'</a>]<br/>
<input type="password" name="password" /><br/>
<input type="submit" value="'. $lang->word('sign_in_1') .'" />
</form>
</div>';
$tpl->div('block',NAV .'<a href="/sign_up/">'. $lang->word('sign_up') .'</a><br/>'.
HICO .'<a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
}