View file system/view/header.php

File size: 4.19Kb
<? 
/**********************************
*	@package: PerfCMS			  *
*	@year: 2012					  *
*	@author: Artas				  *
*	@link: http://perfcms.pp.ua	  *
**********************************/
if(isset($locate) && isset($user)) { $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 "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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"/>
		<? if(!empty($system['description'])) { ?>
		<meta name="description" content="<?=$system['description']; ?>" /> <? } ?>
		<? 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('online', $stat->online());
$tpl->set_value('ads=footer', $stat->ads('footer'));
$tpl->set_value('footer', $stat->footer());
$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('top', '<a href="/mail/">'. $lang->word('new_message') .'</a> (+'.$new_mess.')');
}
echo $stat->ads();
###Уведомления о состояние сайта
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_chat'] == 'no' && $user['level'] < 6 && $locate=='in_chat') {
$tpl->div('menu', $lang->word('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_share') {
$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', NAV .'<a href="/sign_up/">'. $lang->word('sign_up') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
}