Файл: user/menu.php
Строк: 182
<?php
/* DCMS S (Special)
* Дата последнего редактирования 10.12.2015
* Модифицировал densnet
*/
$i = 0;
$inc_foto = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC"), 0);
$foto_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery` WHERE `id_user` = '$ank[id]'"), 0);
$foto_count_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery` WHERE `id_user` = '$ank[id]' AND `time` > '" . (time() - 86400) . "'", $db), 0);
$foto_photo = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_user` = '$ank[id]'"), 0);
$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);
if (IS_WEB) {
$photo = mysql_query("SELECT * FROM `gallery_foto` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC LIMIT 10");
} else {
$photo = mysql_query("SELECT * FROM `gallery_foto` WHERE `id_user` = '$ank[id]' ORDER BY `id` DESC LIMIT 5");
}
if ($inc_foto > 0) {
echo "<div class = 'card-block'>";
while ($photos = mysql_fetch_assoc($photo)) {
echo "<a href = '/modules/foto/$ank[id]/$photos[id_gallery]/$photos[id]/'><img style='margin: 2px;border: 1px solid #C9C9C9;border-radius: 4px;' src='/modules/foto/foto48/$photos[id].$photos[ras]' alt=''/></a>";
}
echo "</div>";
}
echo "<ul class='list-group list-group-flush' style='margin-top: -6px;'>";
if (isset($user)) {
echo "<a href='/user/anketa/?name=$ank[nick]' class='list-group-item'><span class='fa fa-pencil-square-o fa-fw'></span> Анкета</a>";
}
echo "<a href='/user/bookmark/?id=$ank[id]' class='list-group-item'><span class='fa fa-bookmark fa-fw'></span> Закладки <span class='label label-default pull-right' style='float:right;'>$bookmark_count</span></a>";
echo "<a href='/user/friends/?id=$ank[id]' class='list-group-item'><span class='fa fa-users fa-fw'></span> Друзья <span class='label label-default pull-right' style='float:right;'>$k_fr</span></a>";
echo "<a href='/modules/foto/$ank[id]/' class='list-group-item'><span class='fa fa-picture-o fa-fw'></span> Фотографии <span class='label label-default pull-right' style='float:right;'>$foto_photo</span></a>";
$q_menu = mysql_query("SELECT * FROM `profile` ORDER BY `pos` ASC");
while ($post_menu = mysql_fetch_assoc($q_menu)) {
if ($post_menu['private'] == '1')
if (isset($user) && $user['id'] == $ank['id']) {
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='list-group-item' href='$url'>";
echo icons($post_menu['icon'], 'code');
}
echo "$post_menu[name] ";
if ($post_menu['counter'] != NULL && is_file(H . $post_menu['counter'])) {
echo '<span class="label label-default pull-right" style="float:right;">';
@include H . $post_menu['counter'];
echo '</span>';
}
if ($post_menu['type'] == 'link') {
echo "</a>";
}
}
if ($post_menu['private'] == '2')
if (isset($user) && $user['id'] != $ank['id']) {
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='list-group-item' href='$url'>";
echo icons($post_menu['icon'], 'code');
}
echo "$post_menu[name] ";
if ($post_menu['counter'] != NULL && is_file(H . $post_menu['counter'])) {
echo '<span class="label label-default label-pill pull-right" style="float:right;">';
@include H . $post_menu['counter'];
echo '</span>';
}
if ($post_menu['type'] == 'link') {
echo "</a>";
}
}
if ($post_menu['private'] == '0') {
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='list-group-item' href='$url'>";
echo icons($post_menu['icon'], 'code');
}
echo "$post_menu[name] ";
if ($post_menu['counter'] != NULL && is_file(H . $post_menu['counter'])) {
echo '<span class="label label-default label-pill pull-right" style="float:right;">';
@include H . $post_menu['counter'];
echo '</span>';
}
if ($post_menu['type'] == 'link') {
echo "</a>";
}
}
}
echo "</ul>";
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `profile`"), 0);
if (access('adm_profile')) {
if (isset($user) && $user['id'] == $ank['id']) {
echo "<ul class='list-group list-group-flush' style='margin-top: -1px;'>";
echo "<a href='/panel/profile.php' class='list-group-item list-group-item-warning'><i class='fa fa-plus fa-fw'></i> Добавить меню</a>";
echo "<a href='/panel/' class='list-group-item list-group-item-warning'><i class='fa fa-th fa-fw'></i> Панель управления</a>";
echo "<a href='/panel/adm_log.php' class='list-group-item list-group-item-warning'><i class='fa fa-list-alt fa-fw'></i> Действия администрации</a>";
echo "</ul>";
}
}
#Видно другому пользователю, вам не видно
if (isset($user) && $user['id'] != $ank['id']) {
if (isset($user) && $user['level'] > $ank['level'] && $user['id'] != $ank['id']) {
echo "<ul class='list-group list-group-flush' style='margin-top: -6px;'>";
if (access('user_prof_edit')) {
echo "<a href='/panel/user.php?id=$ank[id]' class='list-group-item'><span class='fa fa-pencil-square-o fa-fw'></span> Редактировать</a>";
}
if (access('user_ban_set') || access('user_ban_set_h') || access('user_ban_unset')) {
echo "<a href='/panel/ban.php?id=$ank[id]' class='list-group-item'><span class='fa fa-gavel fa-fw'></span> Дать бан</a>";
}
if (access('user_delete')) {
echo "<a href='/panel/delete_user.php?id=$ank[id]' class='list-group-item'><span class='fa fa-user-times fa-fw'></span> Удалить</a>";
$mass[0] = $ank['id'];
if (access('collisions') && count(collision($mass, 1)) > 1) {
echo "<a href='/panel/delete_user.php?id=$ank[id]&all' class='list-group-item'><span class='fa fa-user-times fa-fw'></span> Удалить все уч. записи</a>";
}
}
if (access('adm_log_read') && $ank['level'] && ($ank['id'] == $user['id'] || $ank['level'] < $user['level'])) {
echo "<a href='/panel/adm_log.php?id=$ank[id]' class='list-group-item'><span class='fa fa-list-alt fa-fw'></span> Отчет действий</a>";
}
echo "</ul>";
}
}