Файл: user/menu.php
Строк: 171
<?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='collection'>";
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;width: 48px;height: 48px;' src='/modules/foto/foto48/$photos[id].$photos[ras]' alt=''/></a>";
}
echo "</div>";
}
echo "<div class='collection'>";
if (isset($user)) {
echo "<a href='/user/anketa/?name=$ank[nick]' class='collection-item'><i class='material-icons left'>assignment_ind</i> Анкета</a>";
}
echo "<a href='/user/bookmark/?id=$ank[id]' class='collection-item'><i class='material-icons left'>star</i> Закладки <span class='badge' style='float:right;'>$bookmark_count</span></a>";
echo "<a href='/user/friends/?id=$ank[id]' class='collection-item'><i class='material-icons left'>group</i> Друзья <span class='badge' style='float:right;'>$k_fr</span></a>";
echo "<a href='/modules/foto/$ank[id]/' class='collection-item'><i class='material-icons left'>photo_album</i> Фотографии <span class='badge' 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');
}
$url = $post_menu['url'];
echo "<a class='collection-item' href='$url'>";
echo icons($post_menu['icon']) . " $post_menu[name] ";
if ($post_menu['counter'] != NULL && is_file(H . $post_menu['counter'])) {
echo '<span class="badge">';
@include H . $post_menu['counter'];
echo '</span>';
}
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');
}
$url = $post_menu['url'];
echo "<a class='collection-item' href='$url'>";
echo icons($post_menu['icon']) . " $post_menu[name] ";
if ($post_menu['counter'] != NULL && is_file(H . $post_menu['counter'])) {
echo '<span class="badge" style="float:right;">';
@include H . $post_menu['counter'];
echo '</span>';
}
echo "</a>";
}
if ($post_menu['private'] == '0') {
if (!isset($post_menu['icon'])) {
mysql_query('ALTER TABLE `profile` ADD `icon` VARCHAR( 32 ) NULL DEFAULT NULL');
}
$url = $post_menu['url'];
echo "<a class='collection-item' href='$url'>";
echo icons($post_menu['icon']) . " $post_menu[name] ";
if ($post_menu['counter'] != NULL && is_file(H . $post_menu['counter'])) {
echo '<span class="badge" style="float:right;">';
@include H . $post_menu['counter'];
echo '</span>';
}
echo "</a>";
}
}
echo "</div>";
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `profile`"), 0);
if (access('adm_profile')) {
if (isset($user) && $user['id'] == $ank['id']) {
echo "<div class='collection'>";
echo "<a href='/panel/profile.php' class='collection-item'><i class='material-icons left'>playlist_add</i> Добавить меню</a>";
echo "<a href='/panel/' class='collection-item'><i class='material-icons left'>storage</i> Панель управления</a>";
echo "<a href='/panel/adm_log.php' class='collection-item'><i class='material-icons left'>assignment</i> Действия администрации</a>";
echo "</div>";
}
}
#Видно другому пользователю, вам не видно
if (isset($user) && $user['id'] != $ank['id']) {
if (isset($user) && $user['level'] > $ank['level'] && $user['id'] != $ank['id']) {
echo "<div class='collection'>";
if (access('user_prof_edit')) {
echo "<a href='/panel/user.php?id=$ank[id]' class='collection-item'><i class='material-icons left'>rate_review</i> Редактировать</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='collection-item'><i class='material-icons left'>gavel</i> Дать бан</a>";
}
if (access('user_delete')) {
echo "<a href='/panel/delete_user.php?id=$ank[id]' class='collection-item'><i class='material-icons left'>delete</i> Удалить</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='collection-item'><i class='material-icons left'>speaker_notes</i> Удалить все уч. записи</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='collection-item'><i class='material-icons left'>assignment</i> Отчет действий</a>";
}
echo "</div>";
}
}