Файл: info.php
Строк: 475
<?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
if ($ank['id']==0)
{
$ank=get_user($ank['id']);
$set['title']=$ank['nick'].' - анкета '; // заголовок страницы
include_once 'sys/inc/thead.php';
title();
aut();
echo "<span class="status">$ank[group_name]</span><br />n";
if ($ank['ank_o_sebe']!=NULL)echo "<span class="ank_n">О себе:</span> <span class="ank_d">$ank[ank_o_sebe]</span><br />n";
if(isset($_SESSION['refer']) && $_SESSION['refer']!=NULL && otkuda($_SESSION['refer']))
echo "<div class='foot'>«<a href='$_SESSION[refer]'>".otkuda($_SESSION['refer'])."</a><br />n</div>n";
include_once 'sys/inc/tfoot.php';
exit;
}
$ank=get_user($ank['id']);
if(!$ank){header("Location: /index.php?".SID);exit;}
$ank['rating']=intval(@mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$ank[id]'"),0));
$set['title']=$ank['nick'].' - анкета '; // заголовок страницы
include_once 'sys/inc/thead.php';
title();
if ((!isset($_SESSION['refer']) || $_SESSION['refer']==NULL)
&& isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=NULL &&
!preg_match('#info.php#',$_SERVER['HTTP_REFERER']))
$_SESSION['refer']=str_replace('&','&',preg_replace('#^http://[^/]*/#','/', $_SERVER['HTTP_REFERER']));
if (isset($_POST['rating']) && isset($user) && $user['id']!=$ank['id'] && $user['balls']>=50 && mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$user[id]'"),0)>=0)
{
$new_r=min(max(@intval($_POST['rating']),-2),2);
mysql_query("DELETE FROM `user_voice2` WHERE `id_user` = '$user[id]' AND `id_kont` = '$ank[id]' LIMIT 1");
if ($new_r)
mysql_query("INSERT INTO `user_voice2` (`rating`, `id_user`, `id_kont`) VALUES ('$new_r','$user[id]','$ank[id]')");
$ank['rating']=intval(mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$ank[id]'"),0));
mysql_query("UPDATE `user` SET `rating` = '$ank[rating]' WHERE `id` = '$ank[id]' LIMIT 1");
if ($new_r>0)
mysql_query("INSERT INTO `mail` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$user[nick] оставил положительный отзыв в [url=/who_rating.php]Вашей анкете[/url]', '$time')");
if ($new_r<0)
mysql_query("INSERT INTO `mail` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$user[nick] оставил негативный отзыв в [url=/who_rating.php]Вашей анкете[/url]', '$time')");
if ($new_r==0)
mysql_query("INSERT INTO `mail` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$user[nick] оставил нейтральный отзыв в [url=/who_rating.php]Вашей анкете[/url]', '$time')");
msg('Ваше мнение о пользователе успешно изменено');
}
aut();
echo "<div class='wm'>";
echo "".status($ank['id'])." $ank[nick]";
echo "".medal($ank['id'])."<br />";
avatar($ank['id']);
if ($ank['group_access']>1)echo "<span class='status'>$ank[group_name]</span><br />n";
echo "</div>";
//////////////////
echo "<div class='wm'>";
echo "<b>Зарегистрирован</b>:<br />".vremja($ank['date_reg'])."<br />n";
echo "</div>";
echo "<div class='wm'>";
echo "<b>Последний визит</b>:<br />".vremja($ank['date_last'])."<br />n";
echo "</div>";
echo "<div class='wm'>";
echo "<b>Активность на форуме</b>:<br />n";
$k_p_forum=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_user` = '$ank[id]'"),0);
echo "Всего сообщений: <a href='/forum/my_pp.php?id=$ank[id]'>$k_p_forum</a><br />n";
$k_them=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_user` = '$ank[id]'"),0);
echo "Всего тем: <a href='/forum/my_tt.php?id=$ank[id]'>$k_them</a></span><br />n";
echo "</div>";
echo "<div class='wm'>";
echo "<b>Виртуальный счёт</b>:<br />n";
echo "Всего монет: $ank[balls]<br />n";
echo "</div>";
##############
echo "<div class='wm'>";
echo "<b>Рейтинг</b>:<br />n";
echo "Подано <a href='who_rating.php?id=$ank[id]'>$ank[rating]</a> голосов<br />n";
echo "</div>";
echo "<div class='wm'>";
echo "<b>Предупреждений</b>:n";
$narush=mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]'"), 0);
echo "".(($narush==0)?" 0<br />n":" $narush<br />n");
echo "</div>";
if ($ank['ank_name']!=NULL)echo "<div class='wm'><b>Имя в реале</b>:<br />$ank[ank_name]</div>n";
if ($ank['ank_city']!=NULL)echo "<div class='wm'><b>Откуда</b>:<br />$ank[ank_city]</div>n";
if ($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL && $ank['ank_g_r']!=NULL){
if ($ank['ank_m_r']==1)$ank['mes']='Января';
elseif ($ank['ank_m_r']==2)$ank['mes']='Февраля';
elseif ($ank['ank_m_r']==3)$ank['mes']='Марта';
elseif ($ank['ank_m_r']==4)$ank['mes']='Апреля';
elseif ($ank['ank_m_r']==5)$ank['mes']='Мая';
elseif ($ank['ank_m_r']==6)$ank['mes']='Июня';
elseif ($ank['ank_m_r']==7)$ank['mes']='Июля';
elseif ($ank['ank_m_r']==8)$ank['mes']='Августа';
elseif ($ank['ank_m_r']==9)$ank['mes']='Сентября';
elseif ($ank['ank_m_r']==10)$ank['mes']='Октября';
elseif ($ank['ank_m_r']==11)$ank['mes']='Ноября';
else $ank['mes']='Декабря';
echo "<div class='wm'><b>Дата рождения</b>:<br />$ank[ank_d_r] $ank[mes] $ank[ank_g_r]г.</div>n";
$ank['ank_age']=date("Y")-$ank['ank_g_r'];
if (date("n")<$ank['ank_m_r'])$ank['ank_age']=$ank['ank_age']-1;
elseif (date("n")==$ank['ank_m_r']&& date("j")<$ank['ank_d_r'])$ank['ank_age']=$ank['ank_age']-1;
//echo "<span class="ank_n">Возраст:</span> <span class="ank_d">$ank[ank_age]</span><br />n";
}
echo "<div class='wm'><b>Пол</b>:<br />".(($ank['pol']==1)?'Муж':'Жен')."</div>n";
##########
if ($ank['ank_xobbi']!=NULL)echo "<div class='wm'><b>Род занятий</b>:<br />$ank[ank_xobbi]</div>n";
##########
if ($ank['ank_interes']!=NULL)echo "<div class='wm'><b>Интересы</b>:<br />$ank[ank_interes]</div>n";
#########
if ($ank['ank_modeltelefona']!=NULL)echo "<div class='wm'><b>Модель телефона</b>:<br />$ank[ank_modeltelefona]</div>n";
#########
if ($ank['ank_operator']!=NULL)echo "<div class='wm'><b>Оператор</b>:<br />$ank[ank_operator]</div>n";
##########
if ($ank['ank_mail']!=NULL)echo "<div class='wm'><b>Адрес e-mail</b>:<br /><a href="mailto:$ank[ank_mail]" title="Написать письмо" class="ank_d">$ank[ank_mail]</a></div>n";
#########
if ($ank['ank_icq']!=NULL)echo "<div class='wm'><b>Номер ICQ</b>:<br />$ank[ank_icq]</div>n";
#########
if ($ank['ank_n_tel']!=NULL)echo "<div class='wm'><b>Номер телефона</b>:<br />$ank[ank_n_tel]</div>n";
##########
if ($ank['ank_sait']!=NULL)echo "<div class='wm'><b>Сайт</b>:<br /><a href='http://$ank[ank_sait]'>http://$ank[ank_sait]</a></div>n";
###############
if ($ank['ank_o_sebe']!=NULL)echo "<div class='wm'><b>О себе</b>:<br />$ank[ank_o_sebe]</div>n";
################################################################################
if (isset($user) && $user['id']!=$ank['id'])echo "<div class='wm'> - <a href="/mail.php?id=$ank[id]"><b>Личное сообщение</b></a></div>n";
################################################################################
if ($user['level']>$ank['level']){
if ($ank['ip']!=NULL){
if (user_access('user_show_ip') && $ank['ip']!=0){
echo "<span class="ank_n">IP:</span> <span class="ank_d">".long2ip($ank['ip'])."</span>";
if (user_access('adm_ban_ip'))
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip]'>Бан</a>]";
echo "<br />n";
}
}
if ($ank['ip_cl']!=NULL){
if (user_access('user_show_ip') && $ank['ip_cl']!=0){
echo "<span class="ank_n">IP (CLIENT):</span> <span class="ank_d">".long2ip($ank['ip_cl'])."</span>";
if (user_access('adm_ban_ip'))
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip_cl]'>Бан</a>]";
echo "<br />n";
}
}
if ($ank['ip_xff']!=NULL){
if (user_access('user_show_ip') && $ank['ip_xff']!=0){
echo "<span class="ank_n">IP (XFF):</span> <span class="ank_d">".long2ip($ank['ip_xff'])."</span>";
if (user_access('adm_ban_ip'))
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip_xff]'>Бан</a>]";
echo "<br />n";
}
}
if (user_access('user_show_ua') && $ank['ua']!=NULL)
echo "<span class="ank_n">UA:</span> <span class="ank_d">$ank[ua]</span><br />n";
if (user_access('user_show_ip') && opsos($ank['ip']))
echo "<span class="ank_n">Пров:</span> <span class="ank_d">".opsos($ank['ip'])."</span><br />n";
if (user_access('user_show_ip') && opsos($ank['ip_cl']))
echo "<span class="ank_n">Пров (CL):</span> <span class="ank_d">".opsos($ank['ip_cl'])."</span><br />n";
if (user_access('user_show_ip') && opsos($ank['ip_xff']))
echo "<span class="ank_n">Пров (XFF):</span> <span class="ank_d">".opsos($ank['ip_xff'])."</span><br />n";
}
if (user_access('user_collisions') && $user['level']>$ank['level'])
{
$mass[0]=$ank['id'];
$collisions=user_collision($mass);
if (count($collisions)>1)
{
echo "<span class="ank_n">Возможные ники:</span><br />n";
echo "<span class="ank_d">n";
for ($i=1;$i<count($collisions);$i++)
{
$ank_coll=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$collisions[$i]' LIMIT 1"));
echo ""<a href='/info.php?id=$ank_coll[id]'>$ank_coll[nick]</a>"<br />n";
}
echo "</span>n";
}
}
if (user_access('adm_ref') && ($ank['level']<$user['level'] || $user['id']==$ank['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user_ref` WHERE `id_user` = '$ank[id]'"), 0))
{
$q=mysql_query("SELECT * FROM `user_ref` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC LIMIT $set[p_str]");
echo "Посещаемые сайты:<br />n";
while ($url=mysql_fetch_assoc($q)) {
$site=htmlentities($url['url'], ENT_QUOTES, 'UTF-8');
echo "<a".($set['web']?" target='_blank'":null)." href='/go.php?go=".base64_encode("http://$site")."'>$site</a> (".vremja($url['time']).")<br />n";
}
echo "<br />n";
}
echo "<div class='foot'>n";
if (isset($user) && $user['id']==$ank['id'])echo "»<a href="/anketa.php">Изменить анкету</a><br />n";
if ($user['level']>$ank['level']){
if (user_access('user_prof_edit'))
echo "»<a href='/adm_panel/user.php?id=$ank[id]'>Редактировать профиль</a><br />n";
if ($user['id']!=$ank['id']){
if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset'))
echo "»<a href='/adm_panel/ban.php?id=$ank[id]'>Нарушения (бан)</a><br />n";
if (user_access('user_delete'))
{
echo "»<a href='/adm_panel/delete_user.php?id=$ank[id]'>Удалить пользователя</a>";
if (count(user_collision($mass,1))>1)
echo " (<a href='/adm_panel/delete_user.php?id=$ank[id]&all'>Все ники</a>)";
echo "<br />n";
}
}
}
if (user_access('adm_log_read') && $ank['level']!=0 && ($ank['id']==$user['id'] || $ank['level']<$user['level']))
echo "»<a href='/adm_panel/adm_log.php?id=$ank[id]'>Отчет по администрированию</a><br />n";
if(isset($_SESSION['refer']) && $_SESSION['refer']!=NULL && otkuda($_SESSION['refer']))
echo "«<a href='$_SESSION[refer]'>".otkuda($_SESSION['refer'])."</a><br />n";
echo "</div>n";
include_once 'sys/inc/tfoot.php';
?>