Файл: user/menu.php
Строк: 178
<?php
/* DCMS S (Special)
* Версия файла 0.0.1
* Дата последнего редактирования 01.11.2015
* Модифицировал densnet
*/
$users = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_user` WHERE `id_user` = '" . $ank['id'] . "'"), 0);
$fotos = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_foto` WHERE `id_user` = '" . $ank['id'] . "'"), 0);
$bookmark_count = $users + $fotos;
$black_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `user_blacklist` WHERE `id_user` = '$ank[id]'"), 0);
$k_fr = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user` = '$ank[id]' AND `i` = '1'"), 0);
//$k_fr_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user` = '$ank[id]' AND `time` > '" . (time() - 86400) . "'", $db), 0);
echo "<table>";
echo "<div class = 'adm_menu'>";
echo "<a href = '/user/bookmark/?id=$ank[id]' class = 'adm_menu_link'><img src = '/style/icons/Star.png' /><div class = 'adm_menu_title'>Закладки ($bookmark_count)</div></a>";
echo "</div>";
echo "<div class = 'adm_menu'>";
echo "<a href = '/user/friends/?id=$ank[id]' class = 'adm_menu_link'><img src = '/style/icons/Man-Suit.png' /><div class = 'adm_menu_title'>Друзья ($k_fr)</div></a>";
echo "</div>";
echo "<div class = 'adm_menu'>";
echo "<a href = '' class = 'adm_menu_link'><img src = '/style/icons/Browser-Question-mark.png' /><div class = 'adm_menu_title'>Нет ссылки</div></a>";
echo "</div>";
echo "</table>";
$q_menu = mysql_query("SELECT * FROM `profile` ORDER BY `pos` ASC");
echo "<table>";
while ($post_menu = mysql_fetch_assoc($q_menu)) {
if ($post_menu['private'] == '1')
if (isset($user) && $user['id'] == $ank['id']) {
echo "<div class = 'adm_menu'>";
if (!isset($post_menu['icon'])) {
mysql_query('ALTER TABLE `profile` ADD `icon` VARCHAR( 32 ) NULL DEFAULT NULL');
}
if (!isset($post_menu['type'])) {
mysql_query("ALTER TABLE `profile` ADD `type` ENUM('link') NOT NULL DEFAULT 'link' AFTER `id`");
}
if ($post_menu['type'] == 'link') {
$url = $post_menu['url'];
echo "<a class = 'adm_menu_link' href='$url'>";
echo icons($post_menu['icon'], 'code');
}
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";
}
if ($post_menu['private'] == '2')
if (isset($user) && $user['id'] != $ank['id']) {
echo "<div class = 'adm_menu'>";
if (!isset($post_menu['icon'])) {
mysql_query('ALTER TABLE `profile` ADD `icon` VARCHAR( 32 ) NULL DEFAULT NULL');
}
if (!isset($post_menu['type'])) {
mysql_query("ALTER TABLE `profile` ADD `type` ENUM('link') NOT NULL DEFAULT 'link' AFTER `id`");
}
if ($post_menu['type'] == 'link') {
$url = $post_menu['url'];
echo "<a class = 'adm_menu_link' href='$url'>";
echo icons($post_menu['icon'], 'code');
}
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";
}
if ($post_menu['private'] == '0') {
echo "<div class = 'adm_menu'>";
if (!isset($post_menu['icon'])) {
mysql_query('ALTER TABLE `profile` ADD `icon` VARCHAR( 32 ) NULL DEFAULT NULL');
}
if (!isset($post_menu['type'])) {
mysql_query("ALTER TABLE `profile` ADD `type` ENUM('link') NOT NULL DEFAULT 'link' AFTER `id`");
}
if ($post_menu['type'] == 'link') {
$url = $post_menu['url'];
echo "<a class = 'adm_menu_link' href='$url'>";
echo icons($post_menu['icon'], 'code');
}
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 `profile`"), 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/profile.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/profile.php' style = 'color:#88C057;text-transform: uppercase;'><img src = '/style/icons/plus.png'/> <b>Добавить меню</b></a>";
echo "</div>";
}
}
#Видно другому пользователю, вам не видно
if (isset($user) && $user['id'] != $ank['id']) {
if (isset($user) && $user['level'] > $ank['level'] && $user['id'] != $ank['id']) {
echo "<div class = 'comm'>";
if (user::access('user_prof_edit')) {
echo "<a href = '/adm_panel/user.php?id=$ank[id]' class = 'add'>Редактировать</a><br /><br />";
}
if (user::access('user_ban_set') || user::access('user_ban_set_h') || user::access('user_ban_unset')) {
echo "<a href = '/adm_panel/ban.php?id=$ank[id]' class = 'add'>Дать бан</a><br /><br />";
}
if (user::access('user_delete')) {
echo "<a href = '/adm_panel/delete_user.php?id=$ank[id]' class = 'add'>Удалить</a>";
$mass[0] = $ank['id'];
if (user::access('user::collisions') && count(user::collision($mass, 1)) > 1) {
echo "<br /><br /><a href = '/adm_panel/delete_user.php?id=$ank[id]&all' class = 'add'>Удалить все уч. записи</a>";
}
}
if (user::access('adm_log_read') && $ank['level'] && ($ank['id'] == $user['id'] || $ank['level'] < $user['level'])) {
echo "<br /><br /><a href = '/adm_panel/adm_log.php?id=$ank[id]' class = 'add'>Отчет действий</a>";
}
echo "</div>";
}
}