Файл: test.masteram.us/comm/user.php
Строк: 48
<?php
include '../Core.php';
if(isset($_GET['id'])){
$id = intval($_GET['id']);
}else{
header("Location: index.php");
}
$s = mysql_result(mysql_query('SELECT COUNT(id) FROM `user` WHERE `id` = '.$id.' LIMIT 1'),0);
if($s==0){
header("Location: /index.php");
exit;
}
$nick = mysql_result(mysql_query("SELECT `nick` FROM `user` WHERE `id` = '".$id."' LIMIT 1"),0);
$set['title']= $nick.' в сообществах ';
include_once '../sys/inc/thead.php';
title();
if($id==0 || $id<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else{
$set['p_str'] = 20;
$k_users = mysql_num_rows(mysql_query("SELECT `id` FROM `community_user_incomm` WHERE `uid` = '".$id."'"));
$k_page = k_page($k_users,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
if($k_users == 0){
echo 'Обитатель не входит ни в одно сообщество<br/>';
}
$q = mysql_query("SELECT * FROM `community_user_incomm` WHERE `uid` = '".$id."' ORDER BY `time` DESC LIMIT $start,$set[p_str]");
echo "<div class='menu_razd'>";
echo 'Сообщества обитателя <b>'.$nick.'</b> <br/>';
echo "</div>n";
while($comm = mysql_fetch_array($q)){
echo " <tr>n";
if($num==1){
echo '<div class="linechat">';
$num=0;
}else{
echo '<div class="linechat">';
$num=1;
}
$name_comm = mysql_fetch_array(mysql_query("SELECT * FROM `community_comm` WHERE `id` = '$comm[cid]' LIMIT 1"));
echo "<img src='/style/icons/friends16.gif' alt='' class='icon'/>n";
echo '<a href="comm.php?id='.$comm['cid'].'">'.esc(trim(stripcslashes(htmlspecialchars($name_comm['name'])))).'</a> <br/>';
echo '</div>';
}
if(mysql_result(mysql_query("SELECT COUNT(id_author) FROM `community_comm` where `id_author` = '$id' LIMIT 1"),0)==1){
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_comm` WHERE `id_author` = '".$id."' LIMIT 1"));
echo '<b>Cоздатель сообщества</b>: <a href="comm.php?id='.$admin['id'].'">'.esc(trim(stripcslashes(htmlspecialchars($admin['name'])))).'</a><br/>';
}
echo "<div class='rekl'>";
echo "<img src='/style/back.gif' alt='' class='icon'/>n";
echo '<a href="/info.php?id='.$id.'">Назад на страничку</a><br/>';
echo "</div>n";
}
include_once '../sys/inc/tfoot.php';
?>