Файл: system/view/header.php
Строк: 174
<?
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.org.ua *
**********************************/
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="uk" xml:lang="uk">
<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"/>
<?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>
<div class="main">
<div align="center" class="panel">
<? if(isset($user)) { echo '<a href="/user/panel/">'. $lang->word('user_panel') .'</a> | <a href="/exit/">'. $lang->word('sign_out') .'</a>'; if($user['level'] >= 6) { echo' | <a href="/padmin/">'. $lang->word('admin_panel').'</a>'; }} else { echo '<a href="/sign_in/">'. $lang->word('sign_in') .'</a> | <a href="/sign_up/">'. $lang->word('sign_up') .'</a>'; } ?>
</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_mess = $db->query("SELECT * FROM `mail` WHERE `who_id` = '". $user['id'] ."' AND `read` = '0'")->rowCount();
if($new_mess>0) {
$tpl->div('menu', img('new_mail.png').'<a href="/mail/">'. $lang->word('new_message') .'</a> [+'.$new_mess.']');
}
$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.']');
}
$new_notify = $db->query("SELECT * FROM `notify` WHERE `user_id` = '". $user['id'] ."' AND `read` = '0'")->rowCount();
if($new_notify > 0)
{
$tpl->div('menu', img('new_notify.png').'<a href="/user/notify">'. $lang->word('notify') .'</a> [+'.$new_notify.']');
}
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_library'] == 'no' && $user['level'] < 6 && $locate=='in_library') {
$tpl->div('menu', $lang->word('library_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($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') .':<br/>
<input type="password" name="password" /><br/>
<input type="submit" value="'. $lang->word('sign_in') .'" />
</form>
</div>';
$tpl->div('block', img('nav.png').' <a href="/user/recovery?">'.$lang->word('recovery').'</a><br/> '. NAV .'<a href="/sign_up/">'. $lang->word('sign_up') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
}