Файл: umenu.php
Строк: 150
<?php
/* DCMS S (Special)
* Версия файла 0.0.1
* Дата последнего редактирования 24.10.2015
* Модифицировал densnet
*/
require_once 'sys/inc/start.php';
require_once 'sys/inc/compress.php';
require_once 'sys/inc/sess.php';
require_once 'sys/inc/settings.php';
require_once 'sys/inc/db_connect.php';
require_once 'sys/inc/ipua.php';
require_once 'sys/inc/fnc.php';
require_once 'sys/inc/user.php';
user::only_reg();
$set['title'] = 'Личный кабинет';
require_once 'sys/inc/thead.php';
title();
aut();
err();
if ((!isset($_SESSION['refer']) || $_SESSION['refer'] == NULL) && isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != NULL &&
!preg_match('#umenu.php#', $_SERVER['HTTP_REFERER'])) {
$_SESSION['refer'] = str_replace('&', '&', preg_replace('#^http://[^/]*/#', '/', $_SERVER['HTTP_REFERER']));
}
echo "<table>";
echo "<div class = 'adm_menu'>";
echo "<a class = 'adm_menu_link'><img src = '/style/icons/Money-Sack.png' /><div class = 'adm_menu_title'>Монеты: $user[money]</div></a>";
echo "</div>";
echo "<div class = 'adm_menu'>";
echo "<a class = 'adm_menu_link'><img src = '/style/icons/Bullish.png' /><div class = 'adm_menu_title'>Активность: $user[activity]</div></a>";
echo "</div>";
echo "<div class = 'adm_menu'>";
echo "<a class = 'adm_menu_link'><img src = '/style/icons/Chart.png' /><div class = 'adm_menu_title'>Рейтинг: $user[rating]</div></a>";
echo "</div>";
echo "</table>";
echo "<div class = 'comm'><b><center>Меню</center></b></div>";
$rekl = mysql_result(mysql_query("SELECT COUNT(*) FROM `rekl` WHERE `sel` = '2'"), 0);
if ($rekl > 0) {
echo "<div class = 'rekl'>";
rekl(2);
echo "</div>";
}
$q_menu = mysql_query("SELECT * FROM `umenu` ORDER BY `pos` ASC");
echo "<table>";
while ($post_menu = mysql_fetch_assoc($q_menu)) {
echo "<div class = 'adm_menu'>";
if (!isset($post_menu['icon'])) {
mysql_query('ALTER TABLE `umenu` ADD `icon` VARCHAR( 32 ) NULL DEFAULT NULL');
}
if (!isset($post_menu['type'])) {
mysql_query("ALTER TABLE `umenu` ADD `type` ENUM('link') NOT NULL DEFAULT 'link' AFTER `id`");
}
if ($post_menu['type'] == 'include') {
if ($post_menu['include'] != NULL && is_file(H . $post_menu['include'])) {
@include H . $post_menu['include'];
}
}
if ($post_menu['type'] == 'link') {
echo "<a class = 'adm_menu_link' href='$post_menu[url]'>";
echo icons($post_menu['icon'], 'code');
} elseif ($post_menu['type'] == 'include') {
echo "<div class = 'null'>";
} else {
echo "<div class = 'comms'><center><b>";
}
echo "<div class = 'adm_menu_title'>$post_menu[name] ";
if ($post_menu['counter'] != NULL && is_file(H . $post_menu['counter'])) {
@include H . $post_menu['counter'];
}
echo "</div>";
if ($post_menu['type'] == 'link') {
echo "</a>";
} else {
echo "</b></center></div>n";
}
echo "</div>n";
}
echo "</table>";
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `umenu`"), 0);
#Если нет разделов меню
if ($k_post == 0) {
echo "<div class = 'comm'>";
echo "<img style = 'vertical-align: middle;' src = '/style/icons/menu.png' /> <span style = 'vertical-align: middle;font-size: 22px;color:#D0D3D8;'>Нет разделов...</span>";
if (user::access('adm_menu')) {
echo "<div class = 'hr'></div>";
echo "<a href = '/adm_panel/umenu.php' style = 'color:#88C057;text-transform: uppercase;'><img src = '/style/icons/plus.png'/> <b>Добавить меню</b></a>";
}
echo "</div>";
} else {
if (user::access('adm_menu')) {
echo "<div class = 'comm'>";
echo "<a href = '/adm_panel/umenu.php' style = 'color:#88C057;text-transform: uppercase;'><img src = '/style/icons/plus.png'/> <b>Добавить меню</b></a>";
echo "</div>";
}
}
if (user::access('adm_panel_show')) {
echo "<table>";
echo "<div class = 'adm_menu'>";
echo "<a href = '/adm_panel/' class = 'adm_menu_link'>n";
echo "<img src = '/style/icons/Browser-Settings.png' /> <div class = 'adm_menu_title'>Панель управления</div>";
echo "</a>";
echo "</div>";
echo "<div class = 'adm_menu'>";
echo "<a href = '?' class = 'adm_menu_link'>n";
echo "<img src = '/style/icons/Browser-Question-mark.png' /> <div class = 'adm_menu_title'>Нет ссылки</div>";
echo "</a>";
echo "</div>";
echo "<div class = 'adm_menu'>";
echo "<a href = '?' class = 'adm_menu_link'>n";
echo "<img src = '/style/icons/Browser-Question-mark.png' /> <div class = 'adm_menu_title'>Нет ссылки</div>";
echo "</a>";
echo "</div>";
echo "</table>";
}
if (isset($_SESSION['refer']) && $_SESSION['refer'] != NULL && otkuda($_SESSION['refer'])) {
echo "<div class = 'comm'>";
echo "<img src = '/style/icons/left.png' /> <a href = '$_SESSION[refer]' style = 'color:#88C057;'>" . otkuda($_SESSION['refer']) . "</a>";
echo "</div>";
}
require_once 'sys/inc/tfoot.php';