Файл: page.php
Строк: 316
<?
include 'connect.php';
include 'core/refresh_friends.php';
include 'core/page_ava.php';
require('core/bb_code.php');
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="title">'. ico($user['sex'],$user['admin']) .' <b>'.$user['login'].'</b> '. online($user['online']) .'';
if($user['rating']>=1000 && $user['rating']<=1999)echo "<img src='ico/b.png' alt='' class='icon'</a>n";
if($user['rating']>=2000 && $user['rating']<=2999)echo "<img src='ico/s.png' alt='' class='icon'</a>n";
if($user['rating']>=3000)echo "<img src='ico/z.png' alt='' class='icon'</a>n";
if($user['vip'] == 1)echo "<img src='ico/vip.gif' alt='' class='icon'</a>n";
echo '</div>';
if($user['delete'] == 1) {
$count = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users_ban_post` WHERE `user` = '".$user['id']."'"), 0);
error('Этот аккаунт был заморожен за нарушение </font><a href="/rules.php">условий использования сервиса </br>
<a href = "user_ban.php?id='.$user['id'].'">Нарушения</a> ('.$count.') ');
if($u['admin'] >= 1 and $u['id'] != $user['id']){
echo '<div class="cred">';
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>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=delete_off&id='.$user['id'].'">Разморозить</option>';
echo '<option value="search_ip.php?&id='.$user['id'].'">Клоны</option>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=shpion_users_in&id='.$user['id'].'">Входящие сообщения</option>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=shpion_users_out&id='.$user['id'].'">Исходящие сообщения</option>';
echo '</select></br>';
if($user['id'] == 1) {
echo ' IP: 66.666.66.666</br>';
echo ' Браузер: Opera by Admin</br>';
} else {
$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 '<div class = "nav">
<span style="color:green;">До конца бана осталось : </span>'.kikt($ban['time_ban']).'<br/>
<span style="color:green;">Заблокировал : </span><a href = "/'.$ban['admin'].'">'.login($ban['admin']).'</a><br/>
<span style="color:green;">Комментарий : </span>'.links($message).' </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 && $ban['who'] <=0) {echo 'Иное';}
echo '</br></div>';
if($u['admin'] >= 1 and $u['id'] != $user['id']){
echo '<div class="cred">';
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>';
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>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=shpion_users_in&id='.$user['id'].'">Входящие сообщения</option>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=shpion_users_out&id='.$user['id'].'">Исходящие сообщения</option>';
echo '</select></br>';
if($user['id'] == 1) {
echo ' IP: 66.666.66.666</br>';
echo ' Браузер: Opera by Admin</br>';
} else {
$ip = $user[ip];
echo ' IP: '.$ip.'</br>';
$ua = $user[ua];
echo ' Браузер: '.$ua.'</br>';
}
echo '</div>';
}
include 'foot.php';
exit;
}
echo '<div class="div">';
$req = mysql_query("SELECT * FROM `microblog_messages` WHERE `user` = '".$user['id']."' AND `main` = '1' LIMIT 1");
if (mysql_num_rows($req)) {
$microblog = mysql_fetch_assoc($req);
if (iconv_strlen($microblog['message'], 'UTF-8') > 50) {
$microblog['message'] = iconv_substr($microblog['message'], 0, 50, 'UTF-8');
$microblog['message']=''.$microblog['message'].'...';
}
$message = checkout($microblog['message']);
echo '<div class="status">';
echo ''.$message.'';
echo '<br><small><span style="font-weight:bold;color:#209143">'.vremya($microblog['time']).'</span>
<a href="microblog.php?act=view&id='.$microblog['id'].'&show=comm"> Комм ('.$microblog['comm'].') »</a>
</small></div><div class="status-img"></div>';
} else {
if($user['id'] == $u['id']) {
echo '<div class="status"><a href = "microblog.php?act=new">Что у вас нового</a>?</div><div class="status-img"></div>';
}
}
echo page_ava($user['id'],100);
echo '</br>';
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 = "/'.$user['id'].'?likes=1"><font color = "red">(+1)</font></a>';
}
}
}
$rat = $user[rating] / 100;
echo '<img src = "ico/like.png" title = "Привлекательность"> '.$user['likes'].' '.$likes.' | <img src = "ico/rating.png" title = "Рейтинг"> '.$rat.' | <img src = "ico/balanse.png" title = "Деньги"> '.$user['money'].'';
echo '</div>';
if($u['admin'] >= 1 and $u['id'] != $user['id']){
echo '<div class="cred">';
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>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=shpion_users_in&id='.$user['id'].'">Входящие сообщения</option>';
if($u['admin'] <= 2 )echo '<option value="adminka.php?act=shpion_users_out&id='.$user['id'].'">Исходящие сообщения</option>';
echo '</select></br>';
if($user['id'] == 1) {
echo ' IP: 66.666.66.666</br>';
echo ' Браузер: Opera by Admin</br>';
} else {
$ip = $user[ip];
echo ' IP: '.$ip.'</br>';
$ua = $user[ua];
echo ' Браузер: '.$ua.'</br>';
}
echo '</div>';
}
echo '<div class="nav">';
echo '<b>Подарки</b> | <a href = "gifts.php?act=list&id='.$user['id'].'">Все подарки</a>';
echo '</div>';
echo '<div class="gifts">';
$c_gifts = mysql_result(mysql_query("SELECT COUNT(*) FROM `gifts_users` WHERE `user` = '".$user['id']."'"), 0);
if($c_gifts > 0){
$result = mysql_query("SELECT * FROM `gifts_users` WHERE `user` = '".$user['id']."' ORDER BY `time` DESC LIMIT 0, 4");
while($gift = mysql_fetch_assoc($result)){
echo '<a href = "gifts.php?act=view&id='.$gift['id'].'"><img src = "gifts/'.$gift['gift'].'.gif" width = "37px"></a>';}}
else {echo '<img src="ico/gift.png"> Нет подарков';}
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="ico/garems.png"> В гареме у <a href = "/'.$garem_user['garem'].'">'.login($garem_user['garem']).'</a></div>';
}
}
if($u['id'] == $user['id']){
$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 = "nav"><img src = "ico/duels.gif"> Сейчас на <a href = "duels.php?act=view&id='.$user['id'].'">дуэли</a> против <a href = "/'.$protiv.'">'.login($protiv).'</a></div>';
}
$count_photo = mysql_result(mysql_query("SELECT COUNT(*) FROM `users_photo` WHERE `user` = '".$user['id']."'"), 0);
echo '</div><div class="div">';
$wall = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `wall` WHERE `wall` = '".$user['id']."'"), 0);
$cgarems = mysql_result(mysql_query("SELECT COUNT(*) FROM `garems_users` WHERE `garem` = '".$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);
if($fa) $fa = '<font color = "red">(+'.$fa.')</font>'; else $fa = '';
if($j) $j = '<font color = "red">('.$j.')</font>'; else $j = '';
if($u['count_mail']) $mn = '(+'.$u['count_mail'].')'; else $mn = '';
echo '<img src="ico/anketa.png" alt="!"/> <a href = "sid=ank"> Анкета</a></br>';
echo '<img src="ico/guest.png" alt="!"/> <a href = "guestbook.php?id='.$user['id'].'"> Гостевая</a> ('.$wall.')</br>';
echo '<img src = "ico/10.gif"> <a href = "friends.php"> Друзья</a> ('.$f.' | <font color = "green">'.$fo.'</font>) '.$fa.'</br>';
echo '<img src="ico/mail.png"> <a href = "mail.php"> Сообщения</a> <font color="red">'.$mn.'</font></br>';
echo '<img src="ico/foto.png"> <a href = "photos.php"> Альбомы</a> ('.$cphotos.' | '.$cphotos2.')</br>';
echo '<img src="ico/notes.png" alt="!"/> <a href = "diary.php?act=view&id='.$user['id'].'"> Дневник</a> ('.$cdiary.')</br>';
echo '<img src="ico/status.png"> <a href = "microblog.php"> Микроблог</a> ('.$cmicroblog.')</br>';
echo '<img src="ico/gift.png"> <a href = "gifts.php?act=list&id='.$user['id'].'"> Подарки</a> ('.$cgifts.')</br>';
echo '<img src="ico/duels.gif"> <a href = "duels.php?act=view&id='.$user['id'].'"> Дуэли</a> ('.$cduels.')</br>';
echo '<img src="ico/garems.png"> <a href = "garems.php?act=view&id='.$user['id'].'"> Гарем</a> ('.$cgarems.')</br>';
echo '<img src="ico/jurnal.gif"> <a href = "jurnal.php"> Журнал</a> '.$j.'</br>';
echo '<img src="ico/stat.png"> <a href = "stat.php"> Статистика</a></br>';
echo '<img src="ico/10.gif"> <a href = "ref.php"> Реферальная система</a></br>';
echo '</div>';
echo '<div class="nav">';
if (!$count_photo)echo '<img src="ico/foto.png"> <a href = "photo.php?act=add">Загрузить фото</a><br/>';
echo '<img src= "ico/office.png"> <a href = "office.php"> Офис </a><br/>';
echo '<small><u>смена ника, vip статус, пополнение монет</u></small></br></div>';
echo '<div class="app">';
echo '<img src="ico/settings.gif"> <a href = "settings.php"> Настройки</a></br>';
} else {
$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 = "nav"><img src = "ico/duels.gif"> Сейчас на <a href = "duels.php?act=view&id='.$user['id'].'">дуэли</a> против <a href = "/'.$protiv.'">'.login($protiv).'</a></div>';
}
$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; }
if($access == true){
echo '<div class="div">';
$wall = mysql_result(mysql_query("SELECT COUNT(`id`) 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);
$cgarems = mysql_result(mysql_query("SELECT COUNT(*) FROM `garems_users` WHERE `garem` = '".$user['id']."'"), 0);
$cduels = mysql_result(mysql_query("SELECT COUNT(*) FROM `duels_list` WHERE `user1` = '".$user['id']."' OR `user2` = '".$user['id']."'"), 0);
echo '<img src="ico/anketa.png" alt="!"/> <a href = "sid=ank?id='.$user['id'].'"> Анкета</a></br>';
echo '<img src="ico/guest.png" alt="!"/> <a href = "guestbook.php?id='.$user['id'].'"> Гостевая</a> ('.$wall.')</br>';
echo '<img src = "ico/10.gif"> <a href = "friends.php?id='.$user['id'].'"> Друзья</a> ('.$f.' | <font color = "green">'.$fo.'</font>)</br>';
echo '<img src="ico/foto.png"> <a href = "photos.php?id='.$user['id'].'"> Альбомы</a> ('.$cphotos.' | '.$cphotos2.')</br>';
echo '<img src="ico/notes.png" alt="!"/> <a href = "diary.php?act=view&id='.$user['id'].'"> Дневник</a> ('.$cdiary.')</br>';
echo '<img src="ico/status.png"> <a href = "microblog.php?id='.$user['id'].'"> Микроблог</a> ('.$cmicroblog.')</br>';
echo '<img src="ico/duels.gif"> <a href = "duels.php?act=view&id='.$user['id'].'"> Дуэли</a> ('.$cduels.')</br>';
echo '<img src="ico/garems.png"> <a href = "garems.php?act=view&id='.$user['id'].'"> Гарем</a> ('.$cgarems.')</br>';
echo '<img src="ico/stat.png"> <a href = "stat.php?id='.$user['id'].'"> Статистика</a></br>';
echo '<img src="ico/10.gif"> <a href = "ref.php?act=view&id='.$user['id'].'"> Рефералы</a></br>';
} else {
echo '<div class="title">Пользователь ограничивает круг лиц, которые могут просматривать эту информацию.</div>';
}
echo '</div>';
echo '<div class="nav">';
echo '<img src="ico/heart.png" alt="!"/> <a href = "flirt.php?id='.$user['id'].'">Флиртовать</a></br>';
echo '<img src="ico/mail.png"> <a href = "mail.php?act=write&id='.$user['id'].'">Написать сообщение</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 = "ico/10.gif"> <a href = "friends.php?act=delete&id='.$user['id'].'">Убрать из друзей</a><br/>';
else echo '<img src = "ico/10.gif"> <a href = "friends.php?act=adding&id='.$user['id'].'">Добавить в друзья</a><br/>';
echo '<img src="ico/gift.png"> <a href = "gifts.php?iduser='.$user['id'].'">Подарить подарок</a><br/>';
echo '<img src = "ico/rating.png"> <a href = "rating.php?id='.$user['id'].'">Поднять</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 = "ico/duels.gif"> <a href = "duels.php?act=add&id='.$user['id'].'">Вызвать на дуэль</a></br>';
}
}
if($garem_user['garem'] != $u['id'] && $user['sex'] != $u['sex']) echo '<img src="ico/garems.png"> <a href = "garems.php?act=add&id='.$user['id'].'">Украсть в гарем</a></br>';
}
echo '</div>';
include 'foot.php';
?>