Файл: test.masteram.us/comm/list_user.php
Строк: 45
<?php
include '../Core.php';
if(isset($_GET['id'])){
$soo = intval($_GET['id']);
}else{
header("Location: /index.php");
}
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
$set['title'] = 'Участники сообщества & '.$_SERVER['HTTP_HOST'];
include_once '../sys/inc/thead.php';
title();
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$user[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
$k_page=mysql_result(mysql_query("SELECT COUNT(id) FROM `community_user_incomm` WHERE `cid` = '$soo'"),0);
$k_page=k_page($k_page,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo "<div class='aut'>";
echo "Сорт:";
echo "<a href='list_user.php?id=".$soo."&page=".$page."&sort=admin'>админ-ия</a> |n";
echo "<a href='list_user.php?id=".$soo."&page=".$page."&sort=uid'>ветераны</a> |n";
echo "<a href='list_user.php?id=".$soo."&page=".$page."&sort=id'>новые</a> n";
echo "</div>n";
echo '<table class="post">';
if($k_page==0){
echo '<tr><td class="p_t">Нет пользователей.</td></tr>';
}
$priv = '`uid`';
$por = 'DESC';
if(isset($_GET['sort']) && $_GET['sort']=='admin'){
$priv = '`priv`';
}else if(isset($_GET['sort']) && $_GET['sort']=='id'){
$priv = '`uid`';
}
else if(isset($_GET['sort']) && $_GET['sort']=='uid'){
$priv = '`id`';
$por='ASC';
}
$q=mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' ORDER BY ".$priv." $por LIMIT $start, $set[p_str]");
while($user_comm = mysql_fetch_array($q)){
$users = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$user_comm[uid]' LIMIT 1"));
echo '<tr><td class="icon14">';
echo avatar2($users['id']);
echo '</td><td class="anput">';
echo ' <a href="/info.php?id='.$users['id'].'"><span style="color:'.$users['ncolor'].'"><b>'.$users['nick'].'</b></span></a> ';
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$user_comm[uid]' AND `id_comm` = '$soo' AND `time` > '$time'"),0)!=0){
echo '<span class="off">Забанен(а)</span>';
}else{
echo online($user_comm['uid']).' ';
}
if(isset($user) && $admin['priv']==2){
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$user_comm[uid]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=1){
echo '[<a href="ban_user.php?id='.$soo.'&uid='.$user_comm['uid'].'">бан</a>]';
}
echo '[<a href="del_user.php?id='.$soo.'&uid='.$user_comm['uid'].'">удал.</a>]<br/>';
echo 'Статус: ';
if($user_comm['priv']!=1){
if($user_comm['priv']!=2){
echo '<a href="pov_user.php?id='.$soo.'&uid='.$user_comm['uid'].'&act=adm">дать админа</a> ';
}else if($user_comm['priv']==2){
echo '<a href="pov_user.php?id='.$soo.'&uid='.$user_comm['uid'].'&act=del_adm">снять с админа</a> ';
}
}
if($user_comm['priv']!=2){
if($user_comm['priv']!=1){
echo '<a href="pov_user.php?id='.$soo.'&uid='.$user_comm['uid'].'&act=mod">дать модера</a>';
}else{
echo '<a href="pov_user.php?id='.$soo.'&uid='.$user_comm['uid'].'&act=del_mod">снять с модера</a>';
}
}
}
echo '</td></tr>';
}
echo '</table>';
if($k_page>1){
str('list_user.php?id='.$soo.'&sort='.$priv.'&',$k_page,$page);
}
echo "<img src='/style/back.gif' alt='' class='icon'/>n";
echo '<a href="comm.php?id='.$soo.'">В сообщество</a><br/>';
}
include_once '../sys/inc/tfoot.php';
?>