Файл: page.php
Строк: 263
<?php
require_once("core/core.php");
require_once("core/page_ava.php");
require_once("core/bb_code.php");
require_once("core/refresh_friends.php");
$location = 'На странице';
if (isset($_GET['id'])) {
$id = num($_GET['id']);
$req = mysql_query("SELECT * FROM `users` WHERE `id` = '$id' LIMIT 1");
if (mysql_num_rows($req)) {
$user = mysql_fetch_assoc($req);
}
}
if (empty($user['id'])) {
if ($u['id']) {
$req = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $u['id'] . "' LIMIT 1");
$user = mysql_fetch_assoc($req);
} else {
header("Location: index.php");
exit;
}
}
refresh_friends($user['id']);
$f = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user` = '" . $user['id'] . "'"), 0);
$fo = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user` = '" . $user['id'] . "' and `online` > '" . (time() - $system['online_time']) . "'"), 0);
$title = $title . ' :: ' . $user['login'] . '';
include 'head.php';
echo '<div class="block_tab"><span class="tab_activ">Профиль</span><a href="stat.php?act=view&id='.$user['id'].'"><span class="tab_item"><font color="black">Активность</font></a></span></div>';
if ($user['delete'] == 1) {
echo '<div class="div">';
echo '' . ico($user['sex'], $user['admin'], $user['online']) . '';
echo ' <b><font color="#79358c">' . $user['login'] . '</font></b>';
echo '' . medal($user['rating']) . '';
$count = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users_ban_post` WHERE `user` = '" . $user['id'] . "'"), 0);
if ($user['delete'] == 1) {
$count_narush = $count + 1;
} else {
$count_narush = $count;
}
echo '<br />Этот аккаунт был заблокирован за нарушение </font><a href="/rules.php">условий использования сервиса </br>
<a href = "user_ban.php?id=' . $user['id'] . '">Нарушения</a> (' . $count_narush . ')';
echo '<hr /><a href="/profile.php?id=' . $user['id'] . '">Анкета</a></br>';
echo '</div>';
if ($u['admin'] >= 1 and $u['id'] != $user['id']) {
echo '<div class="div">';
echo '<select onChange="document.location=this.options[this.selectedIndex].value">';
echo '<option value="?">- Не выбрано -</option>';
if ($u['admin'] <= 2)
echo '<option value="adminka.php?act=edit_users&id=' . $user['id'] . '">Редактировать</option>';
echo '<option value="adminka.php?act=ip_search&id=' . $user['id'] . '">Клоны</option>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=delete_off&id='.$user['id'].'">Разблокировать</option>';
echo '</select></br>';
$ip = "" . $user['ip'] . "";
echo ' IP: ' . $ip . '</br>';
$ua = "" . $user['ua'] . "";
echo ' Браузер: ' . $ua . '</br>';
echo '</div>';
include 'foot.php';
exit;
}
}
if (ban($user['id'])) {
$ban = mysql_fetch_assoc(mysql_query("SELECT * FROM `users_ban` WHERE `user` = '".$user['id']."' ORDER BY `time` DESC"));
$message = checkout($ban['message']);
echo '
<span style="color:green;">До конца бана осталось: </span>' . kikt($ban['time_ban']) . '<br/>
<span style="color:green;">Заблокировал: </span> <a href = "/' . $ban['admin'] . '"><b><font color="#79358c">' . login($ban['admin']) . '</font></b></a><br/>
<span style="color:green;">Дата: </span>' . vremya($ban['time']) . '<br/>
<span style="color:green;"> Причина: </span>';
if ($ban['who'] == 1) {
echo 'Грубость и оскорбления';
}
if ($ban['who'] == 2) {
echo 'Нецензурная лексика';
}
if ($ban['who'] == 3) {
echo 'СПАМ, реклама';
}
if ($ban['who'] == 4) {
echo 'Разжигание ненависти';
}
if ($ban['who'] == 5) {
echo 'Флуд, Оффтопик';
}
if ($ban['who'] == 6) {
echo 'Некорректное название темы';
}
if ($ban['who'] == 7) {
echo 'Бессмысленная тема';
}
if ($ban['who'] == 8) {
echo 'Намеки на ДП';
}
if ($ban['who'] == 9) {
echo 'ДП';
}
if ($ban['who'] == 10) {
echo 'Педофилия';
}
if ($ban['who'] == 11) {
echo 'Иное';
}
if ($ban['who'] == 0) {
echo 'Иное';
}
echo '<br /><span style="color:green;">Комментарий: </span>' . smile(links($message)) . '';
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `users_ban_post` WHERE `user` = '" . $user['id'] . "'"), 0);
if ($user['delete'] == 1) {
$count_narush = $count + 1;
} else {
$count_narush = $count;
}
echo '</br><a href = "user_ban.php?id=' . $user['id'] . '">Нарушения</a> (' . $count_narush . ')</div>';
if ($u['admin'] != $user['admin']) {
if ($u['admin'] >= 1 and $u['id'] != $user['id']) {
echo '<div class="title">';
echo '<select onChange="document.location=this.options[this.selectedIndex].value">';
echo '<option value="?">- Не выбрано -</option>';
if ($u['admin'] <= 2)
echo '<option value="adminka.php?act=edit_users&id=' . $user['id'] . '">Редактировать</option>';
echo '<option value="adminka.php?act=delban_users&id=' . $user['id'] . '">Разбанить</option>';
echo '<option value="adminka.php?act=ip_search&id=' . $user['id'] . '">Клоны</option>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=delete&id='.$user['id'].'">Заблокировать</option>';
echo '</select></br>';
}
if ($user['id'] != 2) {
$ip = "" . $user['ip'] . "";
echo ' IP: ' . $ip . '</br>';
$ua = "" . $user['ua'] . "";
echo ' Браузер: ' . $ua . '</br>';
}
echo '</div>';
}
include 'foot.php';
exit;
}
echo '<div class="menu">';
echo '' . ico($user['sex'], $user['admin'], $user['online']) . '';
echo ' <b><font color="#79358c">' . $user['login'] . '</font></b>';
echo '' . medal($user['rating']) . '';
echo '' . cake($user['cake']) . '';
if (@$u['id'] != $user['id']) {
if ($user['online'] > (time() - $system['online_time'])) {
echo '<font color="black">';
echo ' '.$user['location'].'';
echo '</font>';
}
}
echo '</div>';
if($user['hello']!=NULL)
echo '<div class=div>';
echo '<font color="green">'.$user['hello'].'</font></div><div class=div>';
echo page_ava($user['id'], 80);
echo '</div>';
echo '<div class=div>';
$likes = '';
if (@$u['id'] && $u['id'] != $user['id']) {
$req = mysql_query("SELECT * FROM `users_likes` WHERE `user` = '" . $user['id'] . "' and `outuser` = '" . $u['id'] . "' LIMIT 1");
if (mysql_num_rows($req) == 0) {
if (@$_GET['likes']) {
mysql_query("INSERT INTO `users_likes` SET
`user` = '" . $user['id'] . "',
`outuser` = '" . $u['id'] . "',
`time` = '" . time() . "'
");
$user['likes']++;
mysql_query("UPDATE `users` SET
`likes` = '" . $user['likes'] . "'
WHERE `id` = '" . $user['id'] . "'
");
if ($u['sex'] == 'm') {
$action[0] = 'Отметил';
$action[1] = 'ему';
} else {
$action[0] = 'Отметила';
$action[1] = 'ей';
}
$text = $action[0] . ' что Вы ' . $action[1] . ' понравились.';
mysql_query("INSERT INTO `jurnal` SET
`user` = '" . $user['id'] . "',
`outuser` = '" . $u['id'] . "',
`text` = '$text',
`time` = '" . time() . "',
`new` = '1'
");
} else {
$likes = '<a href = "page.php?id=' . $user['id'] . '&likes=1"> <font color = "red">[поднять на: +1]</font></a>';
}
}
}
$rat = $user['rating'] / 100;
echo '<img src="style/page/like.png"> Популярность: <font color="green">' . $user['likes'] . '</font> ' . $likes . '';
echo '</div>';
if (@$u['admin'] != $user['admin']) {
if (@$u['admin'] >= 1 and $u['id'] != $user['id']) {
if ($user['id'] == 1 || $user['id'] == 2) {
} else {
echo '<div class="div">';
echo '<select onChange="document.location=this.options[this.selectedIndex].value">';
echo '<option value="?">- Не выбрано -</option>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=edit_users&id='.$user['id'].'">Редактировать</option>';
echo '<option value="adminka.php?act=ban_users&id='.$user['id'].'">Забанить</option>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=delete&id='.$user['id'].'">Удалить</option>';
echo '<option value="search_ip.php?&id='.$user['id'].'">Клоны</option>';
echo '</select></br>';
$ip = "" . $user['ip'] . "";
echo ' IP: <u>' . $ip . '</u></br>';
$ua = "" . $user['ua'] . "";
echo ' Браузер: <u>' . $ua . '</u></br>';
echo '</div>';
}
}
}
$c_gifts = mysql_result(mysql_query("SELECT COUNT(*) FROM `gifts_users` WHERE `user` = '" . $user['id'] . "'"), 0);
if ($c_gifts > 0) {
echo '<div class="div">';
$result = mysql_query("SELECT * FROM `gifts_users` WHERE `user` = '" . $user['id'] . "' ORDER BY `time` DESC LIMIT 0, 5");
while ($gift = mysql_fetch_assoc($result)) {
echo '<a href = "gifts.php?act=view&id=' . $gift['id'] . '"> <img src = "gifts/' . $gift['gift'] . '.gif" width = "30px"></a> ';
}
echo '<a href = "gifts.php?act=list&id=' . $user['id'] . '"> <span style="font-size: large;vertical-align: bottom;"> »</span></a>';
echo '</div>';
}
$req = mysql_query("SELECT * FROM `garems_users` WHERE `id` = '" . $user['id'] . "' LIMIT 1");
if (mysql_num_rows($req)) {
$garem_user = mysql_fetch_assoc($req);
if ($garem_user['garem']) {
echo '<div class = "nav"><img src="style/page/garems.gif"> В гареме у <a href = "/page.php?id=' . $garem_user['garem'] . '"><b><font color="#79358c">' . login($garem_user['garem']) . '</font></b></a></div>';
}
}
$req = mysql_query("SELECT * FROM `duels_list` WHERE (`user1` = '" . $user['id'] . "' or `user2` = '" . $user['id'] . "') and `time_end` > '" . time() . "' LIMIT 1");
if (mysql_num_rows($req)) {
$duel = mysql_fetch_assoc($req);
if ($duel['user1'] == $user['id']){
$protiv = $duel['user2'];
}
else
{
$protiv = $duel['user1'];
}
echo '<div class = "div"><img src = "style/page/duels.gif"> Сейчас на <a href = "duels.php?act=view&id=' . $user['id'] . '">Дуэли</a> против <a href = "/page.php?id=' . $protiv . '"><b><font color="#79358c">' . login($protiv) . '</font></b></a></div>';
}
echo '</div>';
if (@$u['id'] == $user['id']) {
$count_photo = mysql_result(mysql_query("SELECT COUNT(*) FROM `users_photo` WHERE `user` = '" . $user['id'] . "'"), 0);
$wall = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `wall` WHERE `wall` = '" . $user['id'] . "'"), 0);
$cduels = mysql_result(mysql_query("SELECT COUNT(*) FROM `duels_list` WHERE `user1` = '" . $user['id'] . "' OR `user2` = '" . $user['id'] . "'"), 0);
$cgifts = mysql_result(mysql_query("SELECT COUNT(*) FROM `gifts_users` WHERE `user` = '" . $user['id'] . "'"), 0);
$cmicroblog = mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_messages` WHERE `user` = '" . $user['id'] . "'"), 0);
$cdiary = mysql_result(mysql_query("SELECT COUNT(*) FROM `diary_messages` WHERE `user` = '" . $user['id'] . "'"), 0);
$cphotos = mysql_result(mysql_query("SELECT COUNT(*) FROM `photos_albums` WHERE `user` = '" . $user['id'] . "'"), 0);
$cphotos2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `photos_photo` WHERE `user` = '" . $user['id'] . "'"), 0);
$cgarems = mysql_result(mysql_query("SELECT COUNT(*) FROM `garems_users` WHERE `garem` = '" . $user['id'] . "'"), 0);
echo '<a href = "/profile.php?id=' . $user['id'] . '"class="div"><img src="/style/page/profile.gif" alt="!"/> Анкета</a></div>';
echo '<a href = "/guestbook.php?id=' . $user['id'] . '"class="div"><img src="/style/page/guestbook.gif" alt="!"/> Гостевая (' . $wall . ')</a></div>';
echo '<a href = "/diary.php?act=view&id=' . $user['id'] . '"class="div"><img src="/style/page/diary.gif" alt="!"/> Дневник (' . $cdiary . ')</a></div>';
echo '<a href = "/friends.php?id=' . $user['id'] . '"class="div"><img src = "/style/page/friends.gif" alt="!"/> Друзья (<font color = "green">' . $fo . '</font> / ' . $f . ')</a></div>';
echo '<a href = "/photos.php"class="div"><img src="/style/page/photos.gif" alt="!"/> Фото (' . $cphotos . ' / ' . $cphotos2 . ')</a></div>';
echo '<a href = "/duels.php?act=view&id=' . $user['id'] . '"class="div"><img src="/style/page/duels.gif" alt="!"/> Мои дуэли (' . $cduels . ')</a></div>';
echo '<a href = "/garems.php?act=view&id=' . $user['id'] . '"class="div"><img src="/style/page/garems.gif" alt="!"/> Мой гарем (' . $cgarems . ')</a></div>';
echo '<a href ="/settings.php"class="div"><img src="/style/page/settings.gif"alt="!"/> Мои настройки</a></div>';
echo '<a href = "/office.php"class="div"><img src= "/style/page/office.gif"alt="!"/> <font color="green">Дополнительные услуги</font> </a></div>';
} else {
@$privfrends = mysql_num_rows(mysql_query("SELECT * FROM `friends` WHERE `user` = '" . $u['id'] . "' and friend = '" . $user['id'] . "' LIMIT 1"));
if ($user['priv_mypage']) {
if ($user['priv_mypage'] == 1) {
if ($privfrends)
$access = true;
else$access = false;
}
if ($user['priv_mypage'] == 2) {
$access = false;
}
} else {
$access = true;
}
$wall = mysql_result(mysql_query("SELECT COUNT(*) FROM `wall` WHERE `wall` = '" . $user['id'] . "'"), 0);
$cphotos = mysql_result(mysql_query("SELECT COUNT(*) FROM `photos_albums` WHERE `user` = '" . $user['id'] . "'"), 0);
$cphotos2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `photos_photo` WHERE `user` = '" . $user['id'] . "'"), 0);
$cdiary = mysql_result(mysql_query("SELECT COUNT(*) FROM `diary_messages` WHERE `user` = '" . $user['id'] . "'"), 0);
$cmicroblog = mysql_result(mysql_query("SELECT COUNT(*) FROM `microblog_messages` WHERE `user` = '" . $user['id'] . "'"), 0);
$cduels = mysql_result(mysql_query("SELECT COUNT(*) FROM `duels_list` WHERE `user1` = '" . $user['id'] . "' OR `user2` = '" . $user['id'] . "'"), 0);
$cgarems = mysql_result(mysql_query("SELECT COUNT(*) FROM `garems_users` WHERE `garem` = '" . $user['id'] . "'"), 0);
echo '<a href = "profile.php?id=' . $user['id'] . '"class=div><img src="/style/page/profile.gif" alt="!"/> Анкета</a></div>';
echo '<a href = "guestbook.php?id=' . $user['id'] . '"class="div"><img src="/style/page/guestbook.gif" alt="!"/> Гостевая (' . $wall . ')</a></div>';
echo '<a href = "diary.php?act=view&id=' . $user['id'] . '"class=div><img src="/style/page/diary.gif" alt="!"/> Дневник (' . $cdiary . ')</a></div>';
echo '<a href = "friends.php?id=' . $user['id'] . '"class="div"><img src = "/style/page/friends.gif" alt="!"/> Друзья (<font color = "green">' . $fo . '</font> / ' . $f . ')</a></div>';
echo '<a href = "photos.php?id=' . $user['id'] . '"class="div"><img src="/style/page/photos.gif" alt="!"/> Фото (' . $cphotos . ' | ' . $cphotos2 . ')</a></div>';
echo '<a href = "duels.php?act=view&id=' . $user['id'] . '"class="div"><img src="/style/page/duels.gif" alt="!"/> Дуэли (' . $cduels . ')</a></div>';
echo '<a href = "garems.php?act=view&id=' . $user['id'] . '"class="div"><img src="/style/page/garems.gif" alt="!"/> Гарем (' . $cgarems . ')</a></div>';
if($u['id']){ echo '<div class="nav">';
echo '<img src="/style/page/go_mail.png" alt="!"/> <a href = "mail.php?act=write&id=' . $user['id'] . '"><u>Написать сообщение</u></a><br/>';
echo '<img src="/style/page/go_gift.gif" alt="!"/> <a href = "gifts.php?iduser=' . $user['id'] . '"><u>Подарить подарок</u></a><br/>';
@$myfriend = mysql_num_rows(mysql_query("SELECT * FROM `friends` WHERE `user` = '" . $u['id'] . "' and friend = '" . $user['id'] . "' LIMIT 1"));
if ($myfriend)
echo '<img src="/style/page/delete.gif" alt="!"/> <a href = "friends.php?act=delete&id=' . $user['id'] . '"><u>Удалить из друзей</u></a><br/>';
else
echo '<img src = "/style/page/go_friend.gif" alt="!"/> <a href = "friends.php?act=adding&id=' . $user['id'] . '"><u>Добавить в друзья</u></a><br/>';
if (!@$duel['id']) {
@$req = mysql_query("SELECT * FROM `duels_list` WHERE (`user1` = '" . $u['id'] . "' or `user2` = '" . $u['id'] . "') and `time_end` > '" . time() . "' LIMIT 1");
if (!mysql_num_rows($req)) {
echo '<img src = "/style/page/duels.gif" alt="!"/> <a href = "duels.php?act=add&id=' . $user['id'] . '"><u>Вызвать на дуэль</u></a></br>';
}
}
if (@$garem_user['garem'] != @$u['id'] && @$user['sex'] != $u['sex'])
echo '<img src="/style/page/garems.gif" alt="!"/> <a href = "garems.php?act=add&id=' . $user['id'] . '"><u>Украсть в гарем</u></a></br>';
}
echo '</div>'; }
require_once("foot.php");
?>