Файл: mob-lave.ru/user/profile/index.php
Строк: 501
<?php
require_once '../../core/set.php';
if (isset($user))$ank['login']=$user['login']; //
if(isset($_GET['login']))
$ank['login'] = check($_GET['login']);
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `$system[perfix]_users` WHERE `login` = '$ank[login]'"));
$ank=get_user($ank['id']); //
if(!$ank){header("Location: /index.php?");exit;}
if ($ank['id']==3){
header('Location: /index.php');
}
$set['title'] = $ank['login'];
require_once H.'core/head.php';
require_once H.'core/panel.php';
echo '<div class="navig">'.$home. $z. $ank['login'].'</div>';
// -------------- В друзья ----------------- //
if(isset($user['id']) && isset($_GET['frends']) && $_GET['frends'] == 'da' && $user['id'] != $ank['id'] && $ank['close_frend'] == 0 &&
(mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends_new` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false &&
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false)){
mysql_query("INSERT INTO `$system[perfix]_frends_new` SET `id_user` = '$user[id]', `id_ank` = '$ank[id]'");
mysql_query("INSERT INTO `$system[perfix]_mail` SET `id_user` = '3', `id_kont` = '$ank[id]', `time` = '".time()."', `msg` = '$user[login] предлагает вам дружбу. [url=/user/profile/frends.php?id=$ank[id]&all]К заявкам[/url]', `read` = '0'");
header("Location: /?login=$ank[login]");
$_SESSION['message'] = 'Предложение дружбы отправлено. Ожидайте подтверждения';
}
if(isset($user['id']) && isset($_GET['frends']) && $user['id'] != $ank['id'] && $ank['close_frend'] == 0 &&
(mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends_new` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false &&
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false)){
echo '<div class="mess">Вы действительно хотите отправить предложение дружбы пользователю <b>'.$ank['login'].'</b>?<br/>';
echo '<div id="dark" class="icon-checkmark"></div><a href="/?login='.$ank['login'].'&frends=da"> Да</a> | <div id="dark" class="icon-undo2 "></div><a href="/?login' .$ank['login'].'"> Нет</a></div>';
}
if($ank['close'] == '1' && $user['id'] != $ank['id'] && $user['level'] == 0 && $ank['close_frend'] == 0 &&
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false){
echo '<div class="err">'.$ank['login'].' закрыл свой профиль от всех кроме друзей!</div>';
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends_new` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false &&
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false && isset($user['id']) && $ank['close_frend'] == 0)
echo '<div class="menu_touch"><a href="/?login='.$ank['login'].'&frends"><div id="dark" class="icon-plus"></div> Добавить в друзья</a></div>';
if(isset($user['id']) && $ank['close_mail'] == 0 or
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == true && $ank['close_mail'] == 1)
echo '<div class="menu_touch"><a href="/user/mail/mail.php?id='.$ank['id'].'"><div id="dark" class="icon-mail"></div> Написать сообщение</a></div>';
else if(isset($user['id']) && $ank['close_mail'] == 0 or
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false && $ank['close_mail'] == 1)
echo '<div class="mess">'.$ank['login'].' закрыл почту для всех, кроме своих друзей</div>';
else if(isset($user['id']) && $ank['close_mail'] == 2)echo '<div class="mess">'.$ank['login'].' закрыл почту для всех</div>';
require_once H.'core/foot.php';
exit();
}
if($ank['close'] == '2' && $user['id'] != $ank['id'] && $user['level'] == 0){
echo '<div class="err">'.$ank['login'].' закрыл свой профиль от всех!</div>';
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends_new` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false &&
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false && isset($user['id']) && $ank['close_frend'] == 0)
echo '<div class="menu_touch"><a href="/?login='.$ank['login'].'&frends"><div id="dark" class="icon-plus"></div> Добавить в друзья</a></div>';
if(isset($user['id']) && $ank['close_mail'] == 0 or
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == true && $ank['close_mail'] == 1)
echo '<div class="menu_touch"><a href="/user/mail/mail.php?id='.$ank['id'].'"><div id="dark" class="icon-mail"></div> Написать сообщение</a></div>';
else if(isset($user['id']) && $ank['close_mail'] == 0 or
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false && $ank['close_mail'] == 1)
echo '<div class="mess">'.$ank['login'].' закрыл почту для всех, кроме своих друзей</div>';
else if(isset($user['id']) && $ank['close_mail'] == 2)echo '<div class="mess">'.$ank['login'].' закрыл почту для всех</div>';
require_once H.'core/foot.php';
exit();
}
$us_ban = mysql_fetch_assoc(mysql_query("SELECT * FROM `$system[perfix]_ban` WHERE `id_user` = '$ank[id]' LIMIT 1"));
if($us_ban['razban_time'] > $time or $us_ban['navsegda'] == 1) $err = 'Пользователь заблокирован за нарушение правил';
err();
echo '<div class="top_group"><table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="top_menu" style="border-radius: 8px 0px 0px 8px"><center>Профиль</center></td>
<td class="top_menu_act"><a href="/user/profile/ank_info.php?u='.$ank['id'].'"><center>Анкета</center></a></td>
<td class="top_menu_act" style="border-radius: 0px 8px 8px 0px"><a href="/user/profile/statistic.php?u='.$ank['id'].'"><center>Статистика</center></a></td>
</tr></table></div>';
echo '<div class="menu"><div style="float:left">';
echo online($ank['id']).$ank['login'];
echo '</div><div style="float:right">';
if(mobile($ank['id']) && $ank['online'] > (time()-$system['online'])) echo '<div id="dark" class="icon-mobile"></div>';
else if(!mobile($ank['id']) && $ank['online'] > (time()-$system['online'])) echo '<div id="dark" class="icon-screen"></div>';
echo '</div><div style="clear:both"></div></div>';
echo '<div class="menu"><table width="100%"><tr><td>';
echo avatar($ank['id'], true, 120);
echo '</td><td align="right" valign="top"><span class="act"><div id="dark" class="icon-coin"></div> '.$ank['money'].'</span></td></tr></table>';
echo '</div>';
if(isset($_POST['admin'])){
$admin = num($_POST['admin']);
if($admin == 0) header("Location: /?login=$ank[login]");
if($admin == 1) header("Location: /admin/ban.php?u=$ank[id]");
if($admin == 2) header("Location: /admin/user.php?edit=$ank[id]");
}
if(($ank['id'] != $user['id'] && isset($user['id']) && (user_access('users_ban') or user_access('users_razban') or user_access('users_ban_navsegda') && $ank['id'] != $user['id'])) or (isset($user['id']) && $ank['id'] != $user['id'] && (user_access('users_edit_anketa') or user_access('users_edit_anketa_osn')))){
echo '<form method="post">
<select name="admin">';
echo '<option value="0">Выберете</option>';
if($ank['id'] != $user['id'] && isset($user['id']) && (user_access('users_ban') or user_access('users_razban') or user_access('users_ban_navsegda')) && $user['level'] > $ank['level']) echo '<option value="1">Заблокировать</option>';
if(isset($user['id']) && (user_access('users_edit_anketa') or user_access('users_edit_anketa_osn')) && $user['level'] > $ank['level']) echo '<option value="2">Редактировать</option>';
echo ' <input type="submit" value=">>" />
</select>
</form>';
}
$referal_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_users` WHERE `referal` = '$ank[id]'"),0);
$foto_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_foto_foto` WHERE `id_user` = '$ank[id]'"),0);
$frends_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE `id_user` = '$ank[id]'"),0);
$notebook = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_notebook` WHERE `id_user` = '$ank[id]'"),0);
$blog = mysql_fetch_assoc(mysql_query("SELECT * FROM `$system[perfix]_blog` WHERE `id_user` = '$ank[id]'"));
$microblog = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_blog_article` WHERE `id_blog` = '$blog[id]'"),0);
$files = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_user_files` WHERE `id_user` = '$ank[id]'"),0);
$predupr = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_predupr` WHERE `id_user` = '$ank[id]'"),0);
echo '<div class="menu_touch"><a href="/moduls/blog/?id='.$ank['id'].'"><div id="dark" class="icon-quill"></div> Микроблог <span class="count">'.$microblog.'</span></a></div>';
echo '<div class="menu_touch"><a href="/user/profile/frends.php?id='.$ank['id'].'"><div id="dark" class="icon-users"></div> Друзья <span class="count">'.$frends_count.'</span></a></div>';
echo '<div class="menu_touch"><a href="/moduls/user_files/?id='.$ank['id'].'"><div id="dark" class="icon-folder"></div> Файлы <span class="count">'.$files.'</span></a></div>';
echo '<div class="menu_touch"><a href="/moduls/foto/'.$ank['id'].'"><div id="dark" class="icon-camera"></div> Фотографии <span class="count">'.$foto_count.'</span></a></div>';
if($ank['id'] == $user['id'] && isset($user['id']) && $system['invite'] == 1)echo '<div class="menu_touch"><a href="/user/profile/invite.php"><div id="dark" class="icon-next"></div> Приглашения <span class="count">'.$referal_count.'</span></a></div>';
echo '<div class="menu_touch"><a href="/moduls/predupr/?id='.$ank['id'].'"><div id="dark" class="icon-lightning"></div> Предупреждения <span class="count">'.$predupr.'</span></a></div>';
if($ank['id'] == $user['id'] && isset($user['id'])){
echo '<div class="menu_touch"><a href="/moduls/notebook/"><div id="dark" class="icon-pencil"></div> Ежедневник <span class="count">'.$notebook.'</span></a></div>';
echo '<div class="menu_touch"><a href="/user/profile/setting.php"><div id="dark" class="icon-settings"></div> Настройки</a></div>';
}
if($ank['id'] != $user['id'] && isset($user['id'])){
echo '<div class="mess">';
if($ank['close_mail'] == 0 or mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == true && $ank['close_mail'] == 1)
echo '<span class="act"><a href="/user/mail/mail.php?id='.$ank['id'].'"><div id="dark" class="icon-mail2"></div></a></span> ';
else if($ank['close_mail'] == 0 or mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false && $ank['close_mail'] == 1)
echo '<span class="act"><div id="dark" class="icon-mail2"></div></span> '; // Закрыл кроме друзей
else if($ank['close_mail'] == 2)echo '<span class="act"><div id="dark" class="icon-mail2"></div></span> '; //Закрыл для всех
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends_new` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false &&
mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_frends` WHERE (`id_user` = '$user[id]' && `id_ank` = '$ank[id]') or (`id_user` = '$ank[id]' && `id_ank` = '$user[id]')"),0) == false && isset($user['id']) && $ank['close_frend'] == 0)
echo ' <span class="act"><a href="/?login='.$ank['login'].'&frends"><div id="dark" class="icon-plus"></div></a></span>';
if($ank['close_frend'] == 1)echo ' <span class="act"><div id="dark" class="icon-plus"></div></span>'; //Не принисать дружбу
echo '</div>';
}
// ------------------ Стена ---------------- //
$count_stena = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_stena` WHERE `id_user` = '$ank[id]'"),0);
$k_n= mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_stena` WHERE `id_user` = '$user[id]' && `time` > '".$ftime."'"), 0);
if ($k_n==0)$k_n=NULL;
else $k_n='<smile><sup>+'.$k_n.'</sup></smile>';
if(isset($_GET['stena']) && $_GET['stena'] == 'close'){ mysql_query("UPDATE `$system[perfix]_users` SET `stena` = '1' WHERE `id` = '$user[id]'");
header("Location: /?login=$ank[login]");}if(isset($_GET['stena']) && $_GET['stena'] == 'open'){ mysql_query("UPDATE `$system[perfix]_users` SET `stena` = '0' WHERE `id` = '$user[id]'");
header("Location: /?login=$ank[login]");}echo '<div class="foot"><table style="width:100%" cellspacing="0" cellpadding="0"><tr><td>';
if($ank['id'] != $user['id']) echo '<font color=white>Стена '.$ank['login'].' ('.$count_stena.') '.$k_n.'</font>';
else echo '<font color=white>Моя стена ('.$count_stena.') '.$k_n.'</font>';
if($user['stena'] == 0 && isset($user['id'])) echo '</td><td align="right"><div id="darks" class="icon-arrow-down"></div> <a href="/?login='.$ank['login'].'&stena=close">Скрыть</a></td>';
if($user['stena'] == 1 && isset($user['id']))echo '</td><td align="right"><div id="darks" class="icon-arrow-up"></div> <a href="/?login='.$ank['login'].'&stena=open">Открыть</a></td>';
echo '</tr></table>';
echo '</div>';
if($user['stena'] == 0) require_once 'stena.php'; //Стена юзера
echo '<div class="mess">Рассказать о '.$ank['login'].' друзьям<br />';
?>
<script type="text/javascript">(function() {
if (window.pluso)if (typeof window.pluso.start == "function") return;
if (window.ifpluso==undefined) { window.ifpluso = 1;
var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
s.src = ('https:' == window.location.protocol ? 'https' : 'http') + '://share.pluso.ru/pluso-like.js';
var h=d[g]('body')[0];
h.appendChild(s);
}})();</script>
<div class="pluso" data-background="transparent" data-options="small,square,line,horizontal,counter,theme=03" data-services="vkontakte,odnoklassniki,facebook,twitter,moimir"></div></div>
<?
echo '<div class="navig">'.$home. $z. $ank['login'].'</div>';
require_once H.'core/foot.php';
?>