<?
//Автор: DjBoBaH 
//Сайт: http://my-perm.net 
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';
include $_SERVER['DOCUMENT_ROOT']."/anti_ hacker.php"; 
if(isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"),0)==1 || isset($user) && !isset($_GET['id']))
{
if(isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"),0)==1)
{
$id=intval($_GET['id']);
$ank=get_user($id);
}
else
{
$ank=get_user($user['id']);
}
$set['title']=$ank['nick'].' в сообществах'; // заголовок страницы
include_once '../sys/inc/thead.php';
echo '<div class="rekl_main">';
title();echo "</div>\n";
echo '<div class="rekl_main">';
aut();
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `soo` WHERE `admid` = '$ank[id]' LIMIT 1"),0)!=0)
{
echo'<b>Сообщества пользователя:</b><br/>';
$q1=mysql_query("SELECT * FROM `soo` WHERE `admid`='$ank[id]' ORDER BY `time` DESC");
while ($adm_soo = mysql_fetch_assoc($q1))
{
echo'<div class="info_razd">';
$users=$adm_soo['users']+1;
echo"<a href='/soo/$adm_soo[id]'>".filter_var($adm_soo['name'], FILTER_SANITIZE_SPECIAL_CHARS)."</a> ($users участников)<br/>";
echo'<span class="ank_n">Описание:</span> <span class="ank_d">'.output_text($adm_soo['desc']).'</span><br/>';
echo'<span class="ank_n">Дата создания:</span> <span class="ank_d">'.vremja($adm_soo['time']).'</span>';
echo'</div>';
}
}
else
{
echo'<center><b>У пользователя нет своих сообществ !</b></center><br/>';
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `soo_users` WHERE `id_user`='$ank[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0)
{
echo'<b>Пользватель не состоит ни в одном из сообществ</b><br/>';
}
else
{
echo'<b>Пользователь состоит в сообществах:</b><br/>';
$q2=mysql_query("SELECT * FROM `soo_users` WHERE `id_user`='$ank[id]' ORDER BY `time` DESC");
while ($soo = mysql_fetch_assoc($q2))
{
$s=mysql_fetch_assoc(mysql_query("SELECT * FROM `soo` WHERE `id` = '$soo[id_soo]' LIMIT 1"));
echo'<div class="info_razd">';
$users2=$s['users']+1;
echo "<a href='/soo/$s[id]'>".filter_var($s['name'], FILTER_SANITIZE_SPECIAL_CHARS)."</a> ($users2 участников)<br/>";
echo'<span class="ank_n">Описание:</span> <span class="ank_d">'.output_text($s['desc']).'</span><br/>';
echo'<span class="ank_n">Дата вступления:</span> <span class="ank_d">'.vremja($soo['time']).'</span>';
if($soo['mod']==1)echo'<br/><span class="ank_n">Статус:</span> <span class="ank_d">Модератор</span>'; else echo'<br/><span class="ank_n">Статус:</span> <span class="ank_d">Пользователь</span>';
echo'</div>';
}
}
}
else
{
header("Location:index.php");
}
include_once '../sys/inc/tfoot.php';
?>