Файл: public_html/theme/dulat/head.php
Строк: 251
<?php
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$headmod = isset($headmod) ? mysql_real_escape_string($headmod) : '';
$textl = isset($textl) ? $textl : $set['copyright'];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="Generator" content="JohnCMS, http://johncms.com" /><!-- ВНИМАНИЕ!!! Данный копирайт удалять нельзя -->
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<?php
(!empty($set['meta_key']) ? "nt" . '<meta name="keywords" content="' . $set['meta_key'] . '" />' : '') .
(!empty($set['meta_desc']) ? "nt" . '<meta name="description" content="' . $set['meta_desc'] . '" />' : '') . PHP_EOL;
?>
<link rel="shortcut icon" href="<?php echo $set['homeurl']; ?>/favicon.ico" type="image/x-icon" />
<link rel="alternate" type="application/rss+xml" title="RSS | <?php echo $lng['site_news']; ?>" href="<?php echo $set['homeurl']; ?>/rss/rss.php" />
<link rel="stylesheet" href="<?php echo $set['homeurl'] . '/' . $_SESSION['path']; ?>style.css" type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo $set['homeurl'] . '/' . $_SESSION['path']; ?>jquery-2.0.2.min.js"></script>
<script type="text/javascript" src="<?php echo $set['homeurl'] . '/' . $_SESSION['path']; ?>jquery-ui-1.10.4.custom.js"></script>
<script type="text/javascript" src="<?php echo $set['homeurl'] . '/' . $_SESSION['path']; ?>jquery.sidr.min.js"></script>
<link rel="stylesheet" href="<?php echo $set['homeurl'] . '/' . $_SESSION['path']; ?>/fonts/foundation-icons.css" type="text/css"/>
<link rel="stylesheet" href="<?php echo $set['homeurl'] . '/' . $_SESSION['path']; ?>/stylesheets/jquery.sidr.light.css" type="text/css"/>
<link rel="stylesheet" href="<?php echo $set['homeurl'] . '/' . $_SESSION['path']; ?>/stylesheets/jquery.sidr.dark.css" type="text/css"/>
<title><?php echo $textl; ?></title>
</head>
<body>
<?php
echo core::display_core_errors();
($headmod == 'mainpage' && count(core::$lng_list) > 1 ? '<div class="selemet"><a href="' . $set['homeurl'] . '/go.php?lng"><b>' . strtoupper(core::$lng_iso) . '</b></a> <img src="' . $set['homeurl'] . '/images/flags/' . core::$lng_iso . '.gif" alt=""/> </div>' : '');
/*
-----------------------------------------------------------------
Рекламный модуль
-----------------------------------------------------------------
*/
$cms_ads = array();
if (!isset($_GET['err']) && $act != '404' && $headmod != 'admin') {
$view = $user_id ? 2 : 1;
$layout = ($headmod == 'mainpage' && !$act) ? 1 : 2;
$req = mysql_query("SELECT * FROM `cms_ads` WHERE `to` = '0' AND (`layout` = '$layout' or `layout` = '0') AND (`view` = '$view' or `view` = '0') ORDER BY `mesto` ASC");
if (mysql_num_rows($req)) {
while (($res = mysql_fetch_assoc($req)) !== FALSE) {
$name = explode("|", $res['name']);
$name = htmlentities($name[mt_rand(0, (count($name) - 1))], ENT_QUOTES, 'UTF-8');
if (!empty($res['color'])) $name = '<span style="color:#' . $res['color'] . '">' . $name . '</span>';
// Если было задано начертание шрифта, то применяем
$font = $res['bold'] ? 'font-weight: bold;' : FALSE;
$font .= $res['italic'] ? ' font-style:italic;' : FALSE;
$font .= $res['underline'] ? ' text-decoration:underline;' : FALSE;
if ($font) $name = '<span style="' . $font . '">' . $name . '</span>';
@$cms_ads[$res['type']] .= '<a href="' . ($res['show'] ? functions::checkout($res['link']) : $set['homeurl'] . '/go.php?id=' . $res['id']) . '">' . $name . '</a><br/>';
if (($res['day'] != 0 && time() >= ($res['time'] + $res['day'] * 3600 * 24)) || ($res['count_link'] != 0 && $res['count'] >= $res['count_link']))
mysql_query("UPDATE `cms_ads` SET `to` = '1' WHERE `id` = '" . $res['id'] . "'");
}
}
}
/*
-----------------------------------------------------------------
Рекламный блок сайта
-----------------------------------------------------------------
*/
if (isset($cms_ads[0])) echo $cms_ads[0];
'</div><div class="maintxt">';
?>
<div class="wrap">
<div class="head">
<div class="panel">
<div class="links">
<?php
echo '<table style="width: 100%;" class="menu"><tr>' .
'<td valign="bottom"><a href="' . $set['homeurl'] . '">' . functions::image('logo.gif', array('class' => '')) . '</a></td>' .
($headmod == 'mainpage' && count(core::$lng_list) > 1 ? '<td align="right"><a href="' . $set['homeurl'] . '/go.php?lng"><b>' . strtoupper(core::$lng_iso) . '</b></a> <img src="' . $set['homeurl'] . '/images/flags/' . core::$lng_iso . '.gif" alt=""/> </td>' : '') .
'</tr></table>';
echo '<div class="phdr"> ' . $lng['hi'] . ', ' . ($user_id ? '<b>' . $login . '</b>!' : $lng['guest'] . '!') . '</div>';
echo '<table style="width:100%" cellspacing="0" cellpadding="0" class="tmn"><tr>' .
(isset($_GET['err']) || $headmod != "mainpage" || ($headmod == 'mainpage' && $act) ? '<td style="vertical-align:top;width:30%;"><a href='' . $set['homeurl'] . '' class="panel"><img src="' . $set['homeurl'] . '/ico/homeb.jpg" alt="Главная"/></a></td>' : '') .
($user_id ? '<td style="vertical-align:top;width:30%;"> <a href="' . $set['homeurl'] . '/users/profile.php?act=office" class="panel"><img src="' . $set['homeurl'] . '/ico/office.jpg" alt="Личный кабинет"/></a></td>' : '') .
($user_id ? '<td style="vertical-align:top;width:30%;"> <a href="' . $set['homeurl'] . '/users/profile.php" class="panel"><img src="' . $set['homeurl'] . '/ico/user.jpg" alt="Моя анкета"/></a></td>' : '') .
($user_id ? '<td style="vertical-align:top;width:30%;"><a href="' . $set['homeurl'] . '/forum" class="panel"><img src="' . $set['homeurl'] . '/ico/journal.jpg" alt="Журнал"/></a></td>' : '<td style="vertical-align:top;width:40%;border-right:solid;border-width:1px;border-color: #A4D3EE;"><a href="' . $set['homeurl'] . '/login.php" class="panel">' . $lng['login'] . '</a></td><td style="vertical-align:top;width:40%;"><a href="' . $set['homeurl'] . '/registration.php" class="panel">' . $lng['registration'] . '</a></td>') .
'</tr></table>';
?>
<div class="both"></div>
</div>
</div>
</div>
<?php if ($user_id) {
echo'<div id="toggle-bar">
<span class="mobile-home">
<a href="' . $set['homeurl'] . '"><i class="fi-home"></i> Домой</a>
</span>
<span class="mobile-login"> <a class=" mtoggle" href="#"><i class="fi-results-demographics"></i> ' . $login . ' </a> </span>
<div class="both"></div> </div>
<nav id="mobile">
<ul id="mmenu" class="mtoggle">
<li><a href="' . $set['homeurl'] . '/users/profile.php?act=office">' . $lng['personal'] . ' <i class="fi-torso"></i></a></li>
<li><a href="' . $set['homeurl'] . '/users/profile.php?act=settings">Мои настройки <i class="fi-widget"></i></a></li>
<li><a href="' . $set['homeurl'] . '/exit.php">Выход <i class="fi-power"></i></a></li>
</ul>
</nav>';}
else {
echo '
<div id="toggle-bar">
<span class="mobile-home">
<a href="' . $set['homeurl'] . '"><i class="fi-home"></i> Домой</a>
</span>
<span class="mobile-login">
<a href="' . $set['homeurl'] . '/login.php"><i class="fi-lock"></i> Войти</a> </span>
<div class="both"></div> </div>';}
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$("#mmenu").hide();
$(".mtoggle").click(function() {
$("#mmenu").slideToggle(500);
});
$('.content').click(function () {
$('#mmenu').hide(500);
});
});
</script>
<div class="equalize">
<?php
require('leftside.php');
/*
-----------------------------------------------------------------
Рекламный блок сайта
-----------------------------------------------------------------
*/
if (!empty($cms_ads[1])) echo '<div class="gmenu">' . $cms_ads[1] . '</div>';
/*
-----------------------------------------------------------------
Фиксация местоположений посетителей
-----------------------------------------------------------------
*/
$sql = '';
$set_karma = unserialize($set['karma']);
if ($user_id) {
// Фиксируем местоположение авторизованных
if (!$datauser['karma_off'] && $set_karma['on'] && $datauser['karma_time'] <= (time() - 86400)) {
$sql .= " `karma_time` = '" . time() . "', ";
}
$movings = $datauser['movings'];
if ($datauser['lastdate'] < (time() - 300)) {
$movings = 0;
$sql .= " `sestime` = '" . time() . "', ";
}
if ($datauser['place'] != $headmod) {
++$movings;
$sql .= " `place` = '" . mysql_real_escape_string($headmod) . "', ";
}
if ($datauser['browser'] != $agn)
$sql .= " `browser` = '" . mysql_real_escape_string($agn) . "', ";
$totalonsite = $datauser['total_on_site'];
if ($datauser['lastdate'] > (time() - 300))
$totalonsite = $totalonsite + time() - $datauser['lastdate'];
mysql_query("UPDATE `users` SET $sql
`movings` = '$movings',
`total_on_site` = '$totalonsite',
`lastdate` = '" . time() . "'
WHERE `id` = '$user_id'
");
} else {
// Фиксируем местоположение гостей
$movings = 0;
$session = md5(core::$ip . core::$ip_via_proxy . core::$user_agent);
$req = mysql_query("SELECT * FROM `cms_sessions` WHERE `session_id` = '$session' LIMIT 1");
if (mysql_num_rows($req)) {
// Если есть в базе, то обновляем данные
$res = mysql_fetch_assoc($req);
$movings = ++$res['movings'];
if ($res['sestime'] < (time() - 300)) {
$movings = 1;
$sql .= " `sestime` = '" . time() . "', ";
}
if ($res['place'] != $headmod) {
$sql .= " `place` = '" . mysql_real_escape_string($headmod) . "', ";
}
mysql_query("UPDATE `cms_sessions` SET $sql
`movings` = '$movings',
`lastdate` = '" . time() . "'
WHERE `session_id` = '$session'
");
} else {
// Если еще небыло в базе, то добавляем запись
mysql_query("INSERT INTO `cms_sessions` SET
`session_id` = '" . $session . "',
`ip` = '" . core::$ip . "',
`ip_via_proxy` = '" . core::$ip_via_proxy . "',
`browser` = '" . mysql_real_escape_string($agn) . "',
`lastdate` = '" . time() . "',
`sestime` = '" . time() . "',
`place` = '" . mysql_real_escape_string($headmod) . "'
");
}
}
/*
-----------------------------------------------------------------
Выводим сообщение о Бане
-----------------------------------------------------------------
*/
if (!empty($ban)) echo '<div class="alarm">' . $lng['ban'] . ' <a href="' . $set['homeurl'] . '/users/profile.php?act=ban">' . $lng['in_detail'] . '</a></div>';
/*
-----------------------------------------------------------------
Ссылки на непрочитанное
-----------------------------------------------------------------
*/
if ($user_id) {
$list = array();
$new_sys_mail = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail` WHERE `from_id`='$user_id' AND `read`='0' AND `sys`='1' AND `delete`!='$user_id';"), 0);
if ($new_sys_mail) $list[] = '<a href="' . $home . '/mail/index.php?act=systems">Система</a> (+' . $new_sys_mail . ')';
$new_mail = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail` LEFT JOIN `cms_contact` ON `cms_mail`.`user_id`=`cms_contact`.`from_id` AND `cms_contact`.`user_id`='$user_id' WHERE `cms_mail`.`from_id`='$user_id' AND `cms_mail`.`sys`='0' AND `cms_mail`.`read`='0' AND `cms_mail`.`delete`!='$user_id' AND `cms_contact`.`ban`!='1' AND `cms_mail`.`spam`='0'"), 0);
if ($new_mail) $list[] = '<a href="' . $home . '/mail/index.php?act=new">' . $lng['mail'] . '</a> (+' . $new_mail . ')';
if ($datauser['comm_count'] > $datauser['comm_old']) $list[] = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?act=guestbook&user=' . $user_id . '">' . $lng['guestbook'] . '</a> (' . ($datauser['comm_count'] - $datauser['comm_old']) . ')';
$new_album_comm = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `user_id` = '" . core::$user_id . "' AND `unread_comments` = 1"), 0);
if ($new_album_comm) $list[] = '<a href="' . core::$system_set['homeurl'] . '/users/album.php?act=top&mod=my_new_comm">' . $lng['albums_comments'] . '</a>';
if (!empty($list)) echo '<div class="rmenu">' . $lng['unread'] . ': ' . functions::display_menu($list, ', ') . '</div>';
}