Файл: sys/inc/main_menu.php
Строк: 446
<?php
$rekl = mysql_result(mysql_query("SELECT COUNT(*) FROM `rekl` WHERE `sel` = '2'"), 0);
if ($rekl > 0) {
echo "<div class = 'rekl'>";
rekl(2);
echo "</div>";
}
if (!isset($_GET['profile'])) {
echo "<a href = '/info.php?id=$user[id]&act=profile'>";
echo "<div class = 'razd'><div class = 'right'><a href='?profile'><img src = '/style/icons/trios.png' /></a></div> <img src = '/style/icons/global.png' /> <b>Мой профиль</b> ";
echo "</div></a>";
} else {
echo "<a href = '/info.php?id=$user[id]&act=profile'>";
echo "<div class = 'razd'><div class = 'right'><a href='?'><img src = '/style/icons/trio.png' /></a></div> <img src = '/style/icons/global.png' /> <b>Мой профиль</b> ";
echo "</div></a>";
echo "Здесь ничего нет...";
}
$mail = mysql_result(mysql_query("SELECT COUNT(DISTINCT `mail`.`id_user`) FROM `mail` LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]' WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` IS NULL OR `users_konts`.`type` = 'common' OR `users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"), 0);
$k_new = mysql_result(mysql_query("SELECT COUNT(`mail`.`id`) FROM `mail` LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]' WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` IS NULL OR `users_konts`.`type` = 'common' OR `users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"), 0);
if ($k_new == 0) {
$k_new = "";
} else {
$k_new = "<span class = 'count'>" . mysql_result(mysql_query("SELECT COUNT(`mail`.`id`) FROM `mail` LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]' WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` IS NULL OR `users_konts`.`type` = 'common' OR `users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"), 0) . "</span>";
}
if (!isset($_GET['mail'])) {
echo "<a href = '/mails.php'>";
echo "<div class = 'razd'><div class = 'right'>";
echo "<a href='?mail'><img src = '/style/icons/trios.png' /></a>";
echo "</div><img src = '/style/icons/mail.png' /> <b>Мои сообщения</b> $k_new</div></a>";
} else {
echo "<a href = '/mails.php'>";
echo "<div class = 'razd'><div class = 'right'>";
echo "<a href='?'><img src = '/style/icons/trio.png' /></a>";
echo "</div><img src = '/style/icons/mail.png' /> <b>Мои сообщения</b> $k_new</div></a>";
$q = mysql_query("SELECT MAX(`mail`.`time`) AS `last_time`, COUNT(`mail`.`id`) AS `count`, `mail`.`id_user`, `users_konts`.`name` FROM `mail` LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]' WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` IS NULL OR `users_konts`.`type` = 'common' OR `users_konts`.`type` = 'favorite') AND `mail`.`read` = '0' GROUP BY `mail`.`id_user` ORDER BY `count` DESC LIMIT 5");
while ($kont = mysql_fetch_assoc($q)) {
$ank = get_user($kont['id_user']);
echo "<a href='/mail.php?id=$ank[id]'><table class = 'razd'><tr><td class = 'icon14'>";
avatar($ank['id'], '30');
echo "</td><td class = 'null'>";
echo "<div class = 'right'><font color = 'grey'>" . vremja($kont['last_time']) . "</font></div>";
if ($ank) {
echo "<b>" . ($kont['name'] ? $kont['name'] : $ank['nick']) . "</b> (новых $kont[count])";
} else {
echo "<b>Пользователь удален</b> (+$kont[count])";
}
$qs = mysql_query("SELECT * FROM `mail` WHERE `id_user` = '$user[id]' AND `id_kont` = '$ank[id]' OR `id_user` = '$ank[id]' AND `id_kont` = '$user[id]' ORDER BY id DESC LIMIT 1");
while ($post = mysql_fetch_array($qs)) {
echo "<table><tr><td class = 'null'>";
echo output_text($post['msg']) . "n";
echo "</td></tr></table>";
}
echo "</td></tr></table></a>";
}
}
if (!isset($_GET['black'])) {
echo "<a href = '/user/blacklist/'>";
echo "<div class = 'razd'><div class = 'right'>";
echo "<a href='?black'><img src = '/style/icons/trios.png' /></a>";
echo "</div><img src = '/style/icons/ban.png' /> <b>Мой черный список</b> $k_new</div></a>";
} else {
echo "<a href = '/user/blacklist/'>";
echo "<div class = 'razd'><div class = 'right'>";
echo "<a href='?'><img src = '/style/icons/trio.png' /></a>";
echo "</div><img src = '/style/icons/ban.png' /> <b>Мой черный список</b> $k_new</div></a>";
$q = mysql_query("SELECT MAX(`mail`.`time`) AS `last_time`, COUNT(`mail`.`id`) AS `count`, `mail`.`id_user`, `users_konts`.`name` FROM `mail` LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]' WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` IS NULL OR `users_konts`.`type` = 'common' OR `users_konts`.`type` = 'favorite') AND `mail`.`read` = '0' GROUP BY `mail`.`id_user` ORDER BY `count` DESC LIMIT 5");
while ($kont = mysql_fetch_assoc($q)) {
$ank = get_user($kont['id_user']);
echo "<a href='/mail.php?id=$ank[id]'><table class = 'razd'><tr><td class = 'icon14'>";
avatar($ank['id'], '30');
echo "</td><td class = 'null'>";
echo "<div class = 'right'><font color = 'grey'>" . vremja($kont['last_time']) . "</font></div>";
if ($ank) {
echo "<b>" . ($kont['name'] ? $kont['name'] : $ank['nick']) . "</b> (новых $kont[count])";
} else {
echo "<b>Пользователь удален</b> (+$kont[count])";
}
$qs = mysql_query("SELECT * FROM `mail` WHERE `id_user` = '$user[id]' AND `id_kont` = '$ank[id]' OR `id_user` = '$ank[id]' AND `id_kont` = '$user[id]' ORDER BY id DESC LIMIT 1");
while ($post = mysql_fetch_array($qs)) {
echo "<table><tr><td class = 'null'>";
echo output_text($post['msg']) . "n";
echo "</td></tr></table>";
}
echo "</td></tr></table></a>";
}
}
if (isset($user)) {
$friends = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends_new` WHERE `to` = '$user[id]'"), 0);
if ($friends == 0) {
$friends = "";
} else {
$friends = "<span class = 'count'>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `friends_new` WHERE `to` = '$user[id]'"), 0) . "</span>";
}
if (!isset($_GET['friends'])) {
echo "<a href = '/user/friends/'>";
echo "<div class = 'razd'><div class = 'right'><a href='?friends'><img src = '/style/icons/trios.png' /></a></div> <img src = '/style/icons/user.png' /> <b>Мои друзья</b> ";
echo "$friends";
echo "</div></a>";
} else {
echo "<a href = '/user/friends/'>";
echo "<div class = 'razd'><div class = 'right'><a href='?'><img src = '/style/icons/trio.png' /></a></div> <img src = '/style/icons/user.png' /> <b>Мои друзья</b> ";
echo "$friends";
echo "</div></a>";
$qk = mysql_query("SELECT * FROM `friends_new` WHERE `to` = '$user[id]' ORDER BY time DESC");
while ($f = mysql_fetch_array($qk)) {
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '" . $f['user'] . "' LIMIT 5"));
echo "<table class = 'razd'><tr><td class = 'icon14'>";
avatar($ank['id'], '30');
echo "</td><td class = 'null'>";
echo "<div class = 'right'><font color = 'grey'>" . vremja($f['time']) . "</font></div>";
echo "<a href = '/info.php?id=$ank[id]'><b>";
echo text::gradient("$ank[nick]", "$ank[ncolor]", "$ank[ncolor2]");
echo "</b></a><br />";
echo "<img src = '/style/icons/thumb_up.png' /> <a href = '/user/friends/new.php?ok=$ank[id]'> Принять</a>";
echo " | ";
echo "<img src = '/style/icons/thumb_down.png' /> <a href = '/user/friends/new.php?no=$ank[id]'> Отклонить</a>";
echo "</td></tr></table>";
}
}
$new_g = mysql_result(mysql_query("SELECT COUNT(*) FROM `myguests` WHERE `id_ank` = '$user[id]' AND `read` = '1'"), 0);
if ($new_g == 0) {
$new_g = "";
} else {
$new_g = "<span class = 'count'>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `myguests` WHERE `id_ank` = '$user[id]' AND `read` = '1'"), 0) . "</span>";
}
if (!isset($_GET['guests'])) {
echo "<a href = '/user/guests.php'>";
echo "<div class = 'razd'><div class = 'right'><a href='?guests'><img src = '/style/icons/trios.png' /></a></div> <img src = '/style/icons/eye1.png' /> <b>Мои гости</b> ";
echo "$new_g";
echo "</div></a>";
} else {
echo "<a href = '/user/guests.php'>";
echo "<div class = 'razd'><div class = 'right'><a href='?'><img src = '/style/icons/trio.png' /></a></div> <img src = '/style/icons/eye1.png' /> <b>Мои гости</b> ";
echo "$new_g<br />Последних 5 гостей";
echo "</div></a>";
$qq = mysql_query("SELECT * FROM `myguests` WHERE `id_ank` = '$user[id]' ORDER BY `time` DESC LIMIT 5");
while ($post = mysql_fetch_array($qq)) {
$ank = get_user($post['id_user']);
if ($post['count'] == 1 || $post['count'] >= 5 && $post['count'] <= 21 || $post['count'] >= 25 && $post['count'] <= 1111111111) {
$kol = "раз";
} elseif ($post['count'] >= 2 && $post['count'] <= 4 || $post['count'] >= 22 && $post['count'] <= 24) {
$kol = "раза";
}
echo "<table class = 'razd'><tr><td class = 'icon14'>";
avatar($ank['id'], '30');
echo "</td><td class = 'null'>";
echo "<div class = 'right'><font color = 'grey'>" . vremja($post['time']) . "</font></div>";
echo "<a href = '/info.php?id=$ank[id]'><b>";
echo text::gradient("$ank[nick]", "$ank[ncolor]", "$ank[ncolor2]");
echo "</b></a><br />";
echo "Был" . ( $user['sex'] == 0 ? 'а' : '' ) . " у вас $post[count] $kol";
echo "</td></tr></table>";
}
}
if (!isset($_GET['photo'])) {
echo "<a href = '/foto/$user[id]/'>";
echo "<div class = 'razd'><div class = 'right'><a href='?photo'><img src = '/style/icons/trios.png' /></a></div> <img src = '/style/icons/photo.png' /> <b>Мои фотографии</b> ";
echo "</div></a>";
} else {
echo "<a href = '/foto/$user[id]/'>";
echo "<div class = 'razd'><div class = 'right'><a href='?'><img src = '/style/icons/trio.png' /></a></div> <img src = '/style/icons/photo.png' /> <b>Мои фотографии</b> ";
echo "</div></a>";
$ank = $user['id'];
$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");
}
echo "<table class = 'razd'><tr><td class = 'icon14'>";
while ($photos = mysql_fetch_assoc($photo)) {
echo "<a href='/foto/$ank[id]/$photos[id_gallery]/$photos[id]/'><img style='margin:1px; height: 40px; width:40px;' src='/foto/foto48/$photos[id].$photos[ras]' alt=''/></a>";
}
echo "</td></tr></table>n";
}
$notification = mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notification` WHERE `id_kont` = '$user[id]' AND `read` = '0' "), 0);
if ($notification == 0) {
$notification = "";
} else {
$notification = "<span class = 'count'>" . mysql_result(mysql_query("SELECT COUNT(`read`) FROM `notification` WHERE `id_kont` = '$user[id]' AND `read` = '0' "), 0) . "</span>";
}
if (!isset($_GET['notification'])) {
echo "<a href = '/user/notification.php'>";
echo "<div class = 'razd'><div class = 'right'><a href='?notification'><img src = '/style/icons/trios.png' /></a></div> <img src = '/style/icons/taps.png' /> <b>Мои уведомления</b> ";
echo "$notification";
echo "</div></a>";
} else {
echo "<a href = '/user/notification.php'>";
echo "<div class = 'razd'><div class = 'right'><a href='?'><img src = '/style/icons/trio.png' /></a></div> <img src = '/style/icons/taps.png' /> <b>Мои уведомления</b> ";
echo "$notification";
echo "</div></a>";
$qt = mysql_query("SELECT * FROM `notification` WHERE `id_kont` = '$user[id]' ORDER BY `id` DESC LIMIT 5");
while ($post = mysql_fetch_assoc($qt)) {
$ank = get_user($post['id_user']);
echo "<table class = 'razd'><tr><td class = 'icon14'>";
avatar($ank['id'], '30');
echo "</td><td class = 'null'>";
echo "<div class = 'right'><font color = 'grey'>" . vremja($post['time']) . "</font></div>";
echo "<a href = '/info.php?id=$ank[id]'><b>";
echo text::gradient("$ank[nick]", "$ank[ncolor]", "$ank[ncolor2]");
echo "</b></a><br />";
echo output_text($post['msg']);
echo "</td></tr></table>";
}
}
if (!isset($_GET['wall'])) {
echo "<a href = '/info.php?id=$user[id]'>";
echo "<div class = 'razd'><div class = 'right'><a href='?wall'><img src = '/style/icons/trios.png' /></a></div> <img src = '/style/icons/pencil.png' /> <b>Моя стена</b> ";
echo "</div></a>";
} else {
echo "<a href = '/info.php?id=$user[id]'>";
echo "<div class = 'razd'><div class = 'right'><a href='?'><img src = '/style/icons/trio.png' /></a></div> <img src = '/style/icons/pencil.png' /> <b>Моя стена</b> ";
echo "</div></a>";
$qt = mysql_query("SELECT * FROM `wall` WHERE `id_wall` = '$user[id]' ORDER BY `id` DESC LIMIT 5");
while ($post = mysql_fetch_assoc($qt)) {
$ank = get_user($post['id_user']);
echo "<table class = 'razd'><tr><td class = 'icon14'>";
avatar($ank['id'], '30');
echo "</td><td class = 'null'>";
echo "<div class = 'right'><font color = 'grey'>" . vremja($post['time']) . "</font></div>";
echo "<a href = '/info.php?id=$ank[id]'><b>";
echo text::gradient("$ank[nick]", "$ank[ncolor]", "$ank[ncolor2]");
echo "</b></a><br />";
echo output_text($post['msg']);
echo "</td></tr></table>";
}
}
if (!isset($_GET['fave'])) {
echo "<a href = '/user/bookmark/'>";
echo "<div class = 'razd'><div class = 'right'><a href='?fave'><img src = '/style/icons/trios.png' /></a></div> <img src = '/style/icons/star0.png' /> <b>Мои закладки</b> ";
echo "</div></a>";
} else {
echo "<a href = '/user/bookmark/'>";
echo "<div class = 'razd'><div class = 'right'><a href='?'><img src = '/style/icons/trio.png' /></a></div> <img src = '/style/icons/star0.png' /> <b>Мои закладки</b> ";
echo "</div></a>";
if (isset($user)) {
$ank['id'] = $user['id'];
}
if (isset($_GET['id'])) {
$ank['id'] = intval($_GET['id']);
}
$ank = get_user($ank['id']);
$users = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_user` WHERE `id_user` = '" . $ank['id'] . "'"), 0);
$foto = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_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);
echo "<a href = '/user/bookmark/users.php?id=$ank[id]'>";
echo "<div class = 'blok'><img src = '/style/icons/group.png' /> Люди ";
echo "<span class = 'count'>";
echo "$users";
echo "</span></div></a>";
echo "<a href = '/user/bookmark/foto.php?id=$ank[id]'>";
echo "<div class = 'blok'><img src = '/style/icons/photos.png' /> Фотографии ";
echo "<span class = 'count'>";
echo "$foto";
echo "</span></div></a>";
echo "<a href = '/user/bookmark/forum.php?id=$ank[id]'>";
echo "<div class = 'blok'><img src = '/style/icons/books_stack.png' /> Форум ";
echo "<span class = 'count'>";
echo "$forum";
echo "</span></div></a>";
}
if (!isset($_GET['diary'])) {
echo "<a href = '/diary/?id=$user[id]'>";
echo "<div class = 'razd'><div class = 'right'><a href='?diary'><img src = '/style/icons/trios.png' /></a></div> <img src = '/style/icons/diary.png' /> <b>Мои дневнеки</b> ";
echo "</div></a>";
} else {
echo "<a href = '/diary/?id=$user[id]'>";
echo "<div class = 'razd'><div class = 'right'><a href='?'><img src = '/style/icons/trio.png' /></a></div> <img src = '/style/icons/diary.png' /> <b>Мои дневнеки</b> ";
echo "</div></a>";
if (isset($user)) {
$ank['id'] = $user['id'];
}
if (isset($_GET['id'])) {
$ank['id'] = intval($_GET['id']);
}
$ank = get_user($ank['id']);
$users = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_user` WHERE `id_user` = '" . $ank['id'] . "'"), 0);
$foto = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_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);
echo "<a href = '/user/bookmark/users.php?id=$ank[id]'>";
echo "<div class = 'blok'><img src = '/style/icons/group.png' /> Люди ";
echo "<span class = 'count'>";
echo "$users";
echo "</span></div></a>";
echo "<a href = '/user/bookmark/foto.php?id=$ank[id]'>";
echo "<div class = 'blok'><img src = '/style/icons/photos.png' /> Фотографии ";
echo "<span class = 'count'>";
echo "$foto";
echo "</span></div></a>";
echo "<a href = '/user/bookmark/forum.php?id=$ank[id]'>";
echo "<div class = 'blok'><img src = '/style/icons/books_stack.png' /> Форум ";
echo "<span class = 'count'>";
echo "$forum";
echo "</span></div></a>";
}
if (!isset($_GET['search'])) {
echo "<a href = '/pages/search/'>";
echo "<div class = 'razd'><div class = 'right'><a href='?search'><img src = '/style/icons/trios.png' /></a></div> <img src = '/style/icons/search.png' /> <b>Поиск</b> ";
echo "</div></a>";
} else {
echo "<a href = '/pages/search/'>";
echo "<div class = 'razd'><div class = 'right'><a href='?'><img src = '/style/icons/trio.png' /></a></div> <img src = '/style/icons/search.png' /> <b>Поиск</b> ";
echo "</div></a>";
if (isset($user)) {
$ank['id'] = $user['id'];
}
if (isset($_GET['id'])) {
$ank['id'] = intval($_GET['id']);
}
$ank = get_user($ank['id']);
$users = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_user` WHERE `id_user` = '" . $ank['id'] . "'"), 0);
$foto = mysql_result(mysql_query("SELECT COUNT(id_user) FROM `bookmark_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);
echo "<a href = '/user/bookmark/users.php?id=$ank[id]'>";
echo "<div class = 'blok'><img src = '/style/icons/group.png' /> Люди ";
echo "<span class = 'count'>";
echo "$users";
echo "</span></div></a>";
echo "<a href = '/user/bookmark/foto.php?id=$ank[id]'>";
echo "<div class = 'blok'><img src = '/style/icons/photos.png' /> Фотографии ";
echo "<span class = 'count'>";
echo "$foto";
echo "</span></div></a>";
echo "<a href = '/user/bookmark/forum.php?id=$ank[id]'>";
echo "<div class = 'blok'><img src = '/style/icons/books_stack.png' /> Форум ";
echo "<span class = 'count'>";
echo "$forum";
echo "</span></div></a>";
}
}