' . "\n" . "\n" . '' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" . '' . // ВНИМАНИЕ!!! Данный копирайт удалять нельзя (!empty($set['meta_key']) ? "\n" . '' : '') . (!empty($set['meta_desc']) ? "\n" . '' : '') . "\n" . '' . "\n" . '' . "\n" . '' . "\n" . '' . $textl . '' . "\n" . '' . core::display_core_errors(); /* ----------------------------------------------------------------- Рекламный модуль ----------------------------------------------------------------- */ $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 = '' . $name . ''; // Если было задано начертание шрифта, то применяем $font = $res['bold'] ? 'font-weight: bold;' : FALSE; $font .= $res['italic'] ? ' font-style:italic;' : FALSE; $font .= $res['underline'] ? ' text-decoration:underline;' : FALSE; if ($font) $name = '' . $name . ''; @$cms_ads[$res['type']] .= '' . $name . '
'; 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]; /* ----------------------------------------------------------------- Выводим логотип и переключатель языков ----------------------------------------------------------------- */ echo '' . '' . ($headmod == 'mainpage' && count(core::$lng_list) > 1 ? '' : '') . '
' . strtoupper(core::$lng_iso) . '  
'; /* ----------------------------------------------------------------- Выводим верхний блок с приветствием ----------------------------------------------------------------- */ echo '
' . $lng['hi'] . ', ' . ($user_id ? '' . $login . '!' : $lng['guest'] . '!') . '
'; /* ----------------------------------------------------------------- Главное меню пользователя ----------------------------------------------------------------- */ echo '
' . (isset($_GET['err']) || $headmod != "mainpage" || ($headmod == 'mainpage' && $act) ? '' . $lng['homepage'] . ' | ' : '') . ($user_id ? '' . $lng['personal'] . ' | ' : '') . ($user_id ? '' . $lng['exit'] . '' : '' . $lng['login'] . ' | ' . $lng['registration'] . '') . '
'; /* ----------------------------------------------------------------- Рекламный блок сайта ----------------------------------------------------------------- */ if (!empty($cms_ads[1])) echo '
' . $cms_ads[1] . '
'; /* ----------------------------------------------------------------- Фиксация местоположений посетителей ----------------------------------------------------------------- */ $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 '
' . $lng['ban'] . ' ' . $lng['in_detail'] . '
'; /* ----------------------------------------------------------------- Ссылки на непрочитанное ----------------------------------------------------------------- */ if ($user_id) { $list = array(); $new_mail = mysql_result(mysql_query("SELECT COUNT(*) FROM `privat` WHERE `user` = '$login' AND `type` = 'in' AND `chit` = 'no'"), 0); if ($new_mail) $list[] = '' . $lng['mail'] . ' (' . $new_mail . ')'; if ($datauser['comm_count'] > $datauser['comm_old']) $list[] = '' . $lng['guestbook'] . ' (' . ($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[] = '' . $lng['albums_comments'] . ''; if (!empty($list)) echo '
' . $lng['unread'] . ': ' . functions::display_menu($list, ', ') . '
'; }