Файл: user/profile/menu.php
Строк: 185
<?php
$friend = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user` = '$ank[id]' AND `i` = '1'"), 0);
$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);
$forum = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `forum_zakl` 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);
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");
}
$bookmark['count'] = $forum + $users + $fotos;
$friends['count'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user` = '$ank[id]' AND `i` = '1'"), 0);
$friends['count']['new'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user` = '$ank[id]' AND `time` > '" . (time() - 86400) . "'", $db), 0);
$friends['online'] = mysql_query("select `friends` from `friends` WHERE `user` = '$ank[id]' AND `i` = '1'");
$notification['count'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `notification` WHERE `id_kont` = '$ank[id]' AND `read` = '0'"), 0);
$notification['count']['new'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `notification` WHERE `id_kont` = '$ank[id]' AND `time` > '" . (time() - 86400) . "'", $db), 0);
$myguest['count'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `myguests` WHERE `id_ank` = '$ank[id]'"), 0);
$myguest['count']['new'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `myguests` WHERE `id_ank` = '$ank[id]' AND `time` > '" . (time() - 86400) . "'", $db), 0);
$diary['count'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `diary` WHERE `id_user` = '$ank[id]'"), 0);
$diary['count']['new'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `diary` WHERE `id_user` = '$ank[id]' AND `time` > '" . (time() - 86400) . "'", $db), 0);
$file = mysql_result(mysql_query("SELECT COUNT(*) FROM `user_files` WHERE `id_user` = '$ank[id]'"), 0);
$count_gifts = mysql_num_rows(mysql_query("SELECT * FROM `gifts` WHERE `id_user` = '$ank[id]'"));
if ($count_gifts > 0) {
echo "<div class='razd'>";
}
$query = mysql_query("SELECT * FROM `gifts` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC LIMIT 6");
while ($post = mysql_fetch_array($query)) {
$gift = mysql_fetch_array(mysql_query("SELECT * FROM `gift` WHERE `id` = '$post[id_gift]'"));
echo "<a href = '/gifts/?id=$ank[id]&gift=$post[id]' style = 'margin-right:4px;'><img src = '/gifts/images/$gift[image]' width = '30' height = '30' /></a>n";
}
if ($count_gifts > 6) {
echo " <a href = '/gifts/?id=$ank[id]' style = 'margin-left: 4px;text-decoration: none;'><span style = 'font-size: large;text-decoration: none;vertical-align: bottom;'>»</span></a>";
}
if ($count_gifts > 0) {
echo "</div>";
}
if ($inc_foto > 0) {
echo "<div class = 'razd'>";
while ($photos = mysql_fetch_assoc($photo)) {
echo "<a href = '/foto/$ank[id]/$photos[id_gallery]/$photos[id]/'><img style = 'margin: 2px;border: 1px solid #C9C9C9;border-radius: 4px;' src='/foto/foto48/$photos[id].$photos[ras]' alt=''/></a>";
}
echo "</div>";
}
#Ваша информация анкетная
if (isset($user)) {
echo "<a href = '/user/anketa/?name=$ank[nick]'>";
if (isset($user) && $user['id'] == $ank['id']) {
echo "<div class = 'razd'><span class = 'icon icon111' /> Моя информация ";
} else {
echo "<div class = 'razd'><span class = 'icon icon111' /> Информация о пользователе ";
}
if (isset($user) && $user['id'] == $ank['id']) {
echo "<span class = 'count' id = 'hides'>";
echo "<a href = '/user/anketa/setting.php'>ред</a>";
echo "</span>";
}
echo "</div></a>";
}
#Фотоальбомы
echo "<a href = '/foto/$ank[id]/'>";
echo "<div class = 'razd'><span class = 'icon icon147' /> Фотографии ";
echo "<span class = 'count'>";
echo "$foto[count] <font color = 'red'>+{$foto['count']['new']}</font> </span><span class = 'count'>$foto[photo] фото";
echo "</span></div></a>";
#Дневники
echo "<a href = '/diary/?id=$ank[id]'>";
echo "<div class = 'razd'><span class = 'icon icon60' /> Дневники ";
echo "<span class = 'count'>";
echo "$diary[count] <font color = 'red'>+{$diary['count']['new']}</font>";
echo "</span></div></a>";
#Файлы
echo "<a href = '/user/files/index.php?id=$ank[id]'>";
echo "<div class = 'razd'><span class = 'icon icon87' /> Файлы ";
echo "<span class = 'count'>";
echo "$file";
echo "</span></div></a>";
#Закладки
echo "<a href = '/user/bookmark/'>";
echo "<div class = 'razd'><span class = 'icon icon22' /> Закладки ";
echo "<span class = 'count'>";
echo "$bookmark[count]";
echo "</span></div></a>";
#Видно другому пользователю, вам не видно
if (isset($user) && $user['id'] != $ank['id']) {
if (isset($user) && $user['level'] > $ank['level'] && $user['id'] != $ank['id']) {
echo "<div class = 'foot'>";
if (user_access('user_prof_edit')) {
echo "<img src = '/style/icons/administrator.png' /> <a href = '/adm_panel/user.php?id=$ank[id]'>Изменить данные пользователя</a><br/>";
}
if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset')) {
echo "<img src = '/style/icons/auction_hammer_gavel.png' /> <a href = '/adm_panel/ban.php?id=$ank[id]'>Выписать нарушение пользователю</a><br/>";
}
if (user_access('user_delete')) {
echo "<img src = '/style/icons/user--minus.png' /> <a href = '/adm_panel/delete_user.php?id=$ank[id]'>Удалить пользователя</a><br/>";
$mass[0] = $ank['id'];
if (user_access('user_collisions') && count(user_collision($mass, 1)) > 1) {
echo "<img src = '/style/icons/list_suspended_accounts.png' /> <a href = '/adm_panel/delete_user.php?id=$ank[id]&all'>Удалить все учетные записи</a><br/>";
}
}
if (user_access('adm_log_read') && $ank['level'] && ($ank['id'] == $user['id'] || $ank['level'] < $user['level'])) {
echo "<img src = '/style/icons/raw_access_logs.png' /> <a href = '/adm_panel/adm_log.php?id=$ank[id]'>Отчет по администрированию</a><br/>";
}
echo "</div>";
}
}