Файл: soo/soo.php
Строк: 737
<?php
require'../config.php';
$align=$set['alignpr'];
$title='Сообщество-'.date("H:i", $time);
head();
aut();
$act = isset($_GET['act']) ? $_GET['act'] : NULL;
switch($_GET['act']){
default:
$soo=trim($_GET['id']);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm_id = 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['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
$comm = mysql_fetch_array(mysql_query("SELECT * FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"));
echo '<span class="status"><b>'.$comm['name'].'</b></span> <span class="ank_n">['.date("d.m H:i", $comm['time_create']).']</span><br/>';
if($comm['status']==1){
echo '<img src="/img/1.gif" alt=""/> (открыт для чтения)<br/>';
}else if($comm['status']==2){
echo '<img src="/img/2.gif" alt=""/> (закрыт для чтения)<br/>';
}
$uchas = mysql_result(mysql_query("SELECT COUNT(uid) FROM `community_user_incomm` where `uid` = '$user[id]' AND `activate` = 1 AND `cid` = '$soo'"),0);
echo '<b>ID сообщества</b>: '.$comm['id'].'<br/>';
echo '<b>Ссылка сообщества</b>: <a href="http://'.$_SERVER['HTTP_HOST'].'/soo/'.$soo.'">http://'.$_SERVER['HTTP_HOST'].'/soo/'.$soo.'</a><br/>';
if ($comm['logo']!='')echo '<img src="/'.$comm['logo'].'" width="'.$set['w_logo_gr'].'" height="'.$set['h_logo_gr'].'" alt="" ><br />';
echo'<font color="red">';
echo '<div class="rowup">'.htmlspecialchars(stripslashes($comm['about'])).'</div>';
echo'</font>';
if($comm['status']==2 or $comm['status']==1 && $uchas){
echo '» <a href="soo.php?act=news&soo='.$comm['id'].'">Новости</a>('.$db->sql_fetchfield($db->sql_query("select count(*) as num from comm_news where comm_id = '$comm[id]'"),0).')<br />';
echo '» <a href="soo.php?act=rules&soo='.$comm['id'].'">Правила</a><br/>';
$list_user = '<b>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `community_user_incomm` WHERE `cid` = '$comm[id]'"),0).'/+'.mysql_result(mysql_query("SELECT COUNT(*) FROM `community_user_incomm` WHERE `cid` = '$comm[id]' AND `time` > '".(time()-86400)."'"),0).'</b>';
echo '» <a href="soo.php?act=list_user&soo='.$comm['id'].'">Участники</a> <span class="ank_n">('.$list_user.')</span><br/>';
echo '» <a href="forum/?soo='.$comm['id'].'">Форум</a> (<a href="forum/new_t?soo='.$comm['id'].'">'.$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `comm_forum_t`;"), 0).'</a>/<a href="forum/new_p?soo='.$comm['id'].'">'.$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `comm_forum_msg`;"), 0).'</a>)<br/>';
if(isset($user) && $admin['priv']==2){
echo '[admin] <a href="soo.php?page=mysoo&act=adm_panel&soo='.$comm['id'].'">Управление</a><br/>';
}
}elseif($comm['status']==1){
echo '» <a href="soo.php?act=news&soo='.$comm['id'].'">Новости</a>('.$db->sql_fetchfield($db->sql_query("select count(*) as num from comm_news where comm_id = '$comm[id]'"),0).')<br />';
echo '» <a href="soo.php?act=rules&soo='.$comm['id'].'">Правила</a><br/>';
$list_user = '<b>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `community_user_incomm` WHERE `cid` = '$comm[id]'"),0).'/+'.mysql_result(mysql_query("SELECT COUNT(*) FROM `community_user_incomm` WHERE `cid` = '$comm[id]' AND `time` > '".(time()-86400)."'"),0).'</b>';
echo '» <a href="soo.php?act=list_user&soo='.$comm['id'].'">Участники</a> <span class="ank_n">('.$list_user.')</span><br/>';
echo '» <a href="forum/?soo='.$comm['id'].'">Форум</a> (<a href="forum/new_t?soo='.$comm['id'].'">'.$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `comm_forum_t`;"), 0).'</a>/<a href="forum/new_p?soo='.$comm['id'].'">'.$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `comm_forum_msg`;"), 0).'</a>)<br/>';
if(isset($user) && $admin['priv']==2){
echo '[admin] <a href="soo.php?page=mysoo&act=adm_panel&soo='.$comm['id'].'">Управление</a><br/>';
}
}
if(isset($user)){
if(mysql_result(mysql_query("SELECT COUNT(uid) FROM `community_user_incomm` where `uid` = '$user[id]' AND `cid` = '$soo'"),0)){
echo '[-] <a href="soo.php?act=out&soo='.$comm['id'].'">Покинуть сообщество</a><br/>';
}else{
echo '[+] <a href="soo.php?act=enter&soo='.$comm['id'].'">Вступить в сообщество</a><br/>';
}
}
echo '» <a href="/soo">В разделы</a><br/>';
}
break;
case'list_user':
$soo=trim($_GET['soo']);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Участники сообществa '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm_id = 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['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{
if (empty($user['max'])) $user['max']=10;
$max = $user['max'];
$total = mysql_num_rows(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo'"));
if ($total > 0)
{
$k_page=k_page($total,$max);
$page=page($k_page);
$start=$max*$page-$max;
$query = $db->sql_query ("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' LIMIT $start, $max");
while ($row = mysql_fetch_array($query))
{
$id_niga=$row['uid'];
$avtor=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$id_niga'"));
echo ''.nik($avtor['id']).'';
echo '</a>['.date("d.m H:i", $row['time']).']</div>';
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$row[uid]' AND `id_comm` = '$soo' AND `time` > '$time'"),0)!=0){
echo '<span class="off">Забанен(а)</span><br/>';}
if(isset($user) && $admin['priv']==2){
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$row[uid]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=1){
echo '[<a href="soo.php?act=ban_user&soo='.$soo.'&uid='.$row['uid'].'">бан</a>]';
}
echo '[<a href="soo.php?act=del_user&soo='.$soo.'&uid='.$row['uid'].'">удал.</a>]<br/>';
echo 'Статус: ';
if($row['priv']!=1){
if($row['priv']!=2){
echo '<a href="soo.php?act=level_user_adm&soo='.$soo.'&uid='.$row['uid'].'">дать админа</a> <br/>';
}else if($row['priv']==2){
echo '<a href="soo.php?act=level_user_del_adm&soo='.$soo.'&uid='.$row['uid'].'">снять с админа</a> <br/>';
}
}
if($row['priv']!=2){
if($row['priv']!=1){
echo '<a href="soo.php?act=level_user_moder&soo='.$soo.'&uid='.$row['uid'].'">дать модера</a><br/>';
}else{
echo '<a href="soo.php?act=level_user_del_moder&soo='.$soo.'&uid='.$row['uid'].'">снять с модера</a><br/>';
}
}
}
}
if ($k_page>1){
echo '<dl><dt></dt></dl>';
str('?',$k_page,$page);
echo '<br /><dl><dt></dt></dl><br />';
}
} else echo '<div>Пусто!</div><br/>';
echo '» <a href="/soo/'.$soo.'">В сообщество</a><br/>';
}
break;
case'rules':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query("SELECT * FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"));
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Правила сообщества '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
echo '<div class="rowup">'.htmlspecialchars(stripslashes($comm['rules'])).'</div>';
echo '» <a href="/soo/'.$comm['id'].'">В сообщество</a><br/>';
break;
case'level_user_adm':
$soo=trim($_GET['soo']);
$uid = trim($_GET['uid']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Повышение участника сообщества '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$uid.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт.</div>';
}else if($user_comm['uid']!=$uid){
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{
mysql_query("UPDATE `community_user_incomm` SET `priv` = '2' WHERE `uid` = '$uid' AND `cid` = '$soo'");
mysql_query("OPTIMIZE TABLE `community_user_incomm`");
$id_niga=$uid;
$avtor=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$id_niga'"));
print'Успешно,'.$avtor['login'].' теперь админ!';
echo '» <a href="/index.php?page=mysoo&id='.$comm['id'].'">В сообщество</a><br/>';
}
break;
case'level_user_del_adm':
$soo=trim($_GET['soo']);
$uid = trim($_GET['uid']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$uid.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт.</div>';
}else if($user_comm['uid']!=$uid){
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{
mysql_query("UPDATE `community_user_incomm` SET `priv` = '0' WHERE `uid` = '$uid' AND `cid` = '$soo'");
mysql_query("OPTIMIZE TABLE `community_user_incomm`");
$id_niga=$uid;
$avtor=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$id_niga'"));
print'Успешно,'.$avtor['login'].' снят с должности админа!';
echo '» <a href="/index.php?page=mysoo&id='.$comm['id'].'">В сообщество</a><br/>';
}
break;
case'level_user_moder':
$soo=trim($_GET['soo']);
$uid = trim($_GET['uid']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$uid.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт.</div>';
}else if($user_comm['uid']!=$uid){
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{
mysql_query("UPDATE `community_user_incomm` SET `priv` = '1' WHERE `uid` = '$uid' AND `cid` = '$soo'");
mysql_query("OPTIMIZE TABLE `community_user_incomm`");
$id_niga=$uid;
$avtor=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$id_niga'"));
print'Успешно,'.$avtor['login'].' теперь модер!';
echo '» <a href="/index.php?page=mysoo&id='.$comm['id'].'">В сообщество</a><br/>';
}
break;
case'level_user_del_moder':
$soo=trim($_GET['soo']);
$uid = trim($_GET['uid']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$uid.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт.</div>';
}else if($user_comm['uid']!=$uid){
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{
mysql_query("UPDATE `community_user_incomm` SET `priv` = '0' WHERE `uid` = '$uid' AND `cid` = '$soo'");
mysql_query("OPTIMIZE TABLE `community_user_incomm`");
$id_niga=$uid;
$avtor=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$id_niga'"));
print'Успешно,'.$avtor['login'].' снят с должности модера!';
echo '» <a href="/index.php?page=mysoo&id='.$comm['id'].'">В сообщество</a><br/>';
}
break;
case'ban_user':
$soo=trim($_GET['soo']);
$uid = trim($_GET['uid']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$uid.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($uid==0 || $uid<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2 && $admin['priv']!=1){
echo '<div class="err">Вы не админ и не модератор.</div>';
}else if($user_comm['uid']!=$uid){
echo '<div class="err">Данный пользователь не участвует в сообществе</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
$id_niga=$uid;
$avtor=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$id_niga'"));
echo' <b>Забанить: '.$avtor['login'].'</b><br/>
<form action="/index.php?page=mysoo&act=ban_ok&id='.$soo.'&uid='.$uid.'" method="post">
Дополнительная информация(причина):<br/>
<input type="text" name="dopinf" class="form"><br/>
На срок (в секундах):<br/>
Например:<br/>
1 час - 3600<br/>
12 часов - 43200<br/>
сутки - 86400<br/>
2 дня - 172800<br/>
неделя - 604800<br/>
месяц - 2678400<br/>
<small>Если ничего не вводить - будет бан до отмены.</small><br/>
<input type="text" name="srokban" class="form"><br/>
<input type="submit" value="В баню!" class="but"><br/>
</form>
</div><div class="p">';
}
break;
case'ban_user_ok':
///////////sam ban///////////////
break;
case'enter':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$q = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = '.$us['id'].' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$us['id'].' LIMIT 1'));
$status_comm = mysql_fetch_array(mysql_query("SELECT * FROM `community_comm` WHERE `id` = '$soo' LIMIT 1"));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($user_comm['uid']==$us['id']){
echo '<div class="err">Вы уже вступали в данное сообщество.</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
if($status_comm['status']==2){
mysql_query("INSERT INTO `community_user_incomm` (`uid`, `cid`, `time`, `priv`, `postov`, `them`, `files`) VALUES ('$us[id]', '$soo', '$time', '0', '0', '0', '0')");
$msg = 'Обитатель '.$q['login'].', хочет вступить в Ваше сообщество. Вы можете ему разрешить или отказать в вступлении. Для этого зайдите в админку в сообществе';
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `time`, `msg`, `read`) VALUES ('0', '$comm[id_author]', '$time', '$msg', '0')");
print'Ждите... ответа создателя';
}else{
mysql_query("INSERT INTO `community_user_incomm` (`uid`, `cid`, `time`, `priv`, `postov`, `them`, `files`) VALUES ('$us[id]', '$soo', '$time', '0', '0', '0', '0')");
echo '» <a href="/soo/'.$comm['id'].'">Назад в сообщество сообщество</a><br/>';
}
}
break;
case'activate':
$soo=trim($_GET['soo']);
$uid = trim($_GET['uid']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$uid.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт.</div>';
}else if($user_comm['uid']!=$uid){
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{
$count_p=mysql_result(mysql_query("SELECT COUNT(*) FROM `community_user_incomm` WHERE `activate` = '0' AND `cid` = '$soo'"),0);
if ($count_p > 0)
{
$col = 6;
$page_all = ceil($count_p / $col);
$page = isset($_GET['p']) ? (int)$_GET['p'] : 1;
if ($page < 1) $page = 1;
if ($page > $page_all) $page = $page_all;
$start = ($page * $col) - $col;
if (!preg_match('#^[0-9]{1,3}$#i', $page)) $page = 1;
$sql = mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `activate` = '0' LIMIT ".$start.", ".$col);
echo '<div style="margin: 2px; background-color: #FFFFFF; border: 1px solid #CCCCCC">';
while ($row = mysql_fetch_array($sql))
{
$id_niga=$row['uid'];
$avtor=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$id_niga'"));
echo '<div>- <a href="http://'.$_SERVER['HTTP_HOST'].'/'.$row['uid'].'">'.$avtor['user'].'</a>['.date("d.m H:i", $row['time']).']</div><br/>';
echo '<a href="soo.php?act=activate_yes&soo='.$soo.'&uid='.$row['uid'].'">Активировать</a> | <a href="soo.php?act=activate_no&soo='.$soo.'&uid='.$row['uid'].'">Отказать</a><br/>';
}
echo '</div>';
$url_page = $_SERVER['PHP_SELF'].'?page=music&';
page($count_p, $page, $url_page, $page_all);
} else echo '<div>пусто</div>';
}
break;
case'activate_yes':
$soo=trim($_GET['soo']);
$uid = trim($_GET['uid']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$uid.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт.</div>';
}else if($user_comm['uid']!=$uid){
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{
if($user_comm['uid']!=$uid){
echo '<div class="err">Данный пользователь не подовал заявку на вступление.</div>';
}else if($user_comm['activate']==1){
echo '<div class="err">Данный пользователь уже был активирован.</div>';
}else{
mysql_query("UPDATE `community_user_incomm` SET `activate` = '1' WHERE `uid` = '$uid' AND `cid` = '$soo' LIMIT 1");
$msg = 'Ваша заявка на вступление в сообщество [b]'.$comm['name'].'[/b] успешно одобрена';
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `time`, `msg`, `read`) VALUES ('0', '$uid', '$time', '$msg', '0')");
mysql_query("OPTIMIZE TABLE `community_user_incomm`, `jurnal`");
print'Успешно';
echo '» <a href="/soo/'.$comm['id'].'">В сообщество</a><br/>';
}
}
break;
case'activate_no':
$soo=trim($_GET['soo']);
$uid = trim($_GET['uid']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$uid.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт.</div>';
}else if($user_comm['uid']!=$uid){
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{
if($user_comm['uid']!=$uid){
echo '<div class="err">Данный пользователь не подовал заявку на вступление.</div>';
}else if($user_comm['activate']==1){
echo '<div class="err">Данный пользователь уже был активирован.</div>';
}else{
mysql_query("DELETE FROM `community_user_incomm` WHERE `uid` = '$uid' AND `cid` = '$soo' LIMIT 1");
$msg = 'Извените, но Вам отказали в вступлении в сообщество '.$comm['name'].'';
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `time`, `msg`, `read`) VALUES ('0', '$uid', '$time', '$msg', '0')");
mysql_query("OPTIMIZE TABLE `community_user_incomm`, `jurnal`");
print'Успешно <br/>';
echo '» <a href="/soo/'.$comm['id'].'">В сообщество</a><br/>';
}
}
break;
case'out':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Участники сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm_id = 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($admin['uid']!=0){
echo '<div class="err">Вы не может покинуть сообщество</div>';
}else if($soo!=$comm_id['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{
mysql_query("DELETE FROM `community_user_incomm` WHERE `uid` = '$user[id]' AND `cid` = '$soo'");
print'Успешно';
}
break;
case'del_user':
$soo=trim($_GET['id']);
$uid = trim($_GET['uid']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$user_comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_user_incomm` WHERE `cid` = '.$soo.' AND `uid` = '.$uid.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Доступ закрыт.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Вы не админ.</div>';
}else if($user_comm['uid']!=$uid){
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{
mysql_query("DELETE FROM `community_user_incomm` WHERE `uid` = '$uid' AND `cid` = '$soo' LIMIT 1");
mysql_query("DELETE FROM `comm_ban` WHERE `id_user = '$uid' AND `id_comm` = '$soo'");
mysql_query("OPTIMIZE TABLE `community_user_incomm`, `comm_ban`");
print'Успешно<br/>';
}
break;
case'adm_panel':
$soo=trim($_GET['soo']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
echo '<b>Управление сообществом.</b><br/>';
echo '» <a href="soo.php?act=icon&soo='.$soo.'">Логотип</a><br/>';
echo '» <a href="soo.php?act=adm_news&soo='.$soo.'">Добавить новость</a><br/>';
echo '» <a href="soo.php?act=rules_adm&soo='.$soo.'">Правила</a><br/>';
echo '» <a href="soo.php?act=adm_soo&soo='.$soo.'">Сообщество</a><br/>';
if($comm['status']==2){
echo '» <a href="soo.php?act=activate&soo='.$soo.'">Активация участников</a><br/>';
}
}
break;
case'rules_adm':
$soo=trim($_GET['soo']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
echo '<form method="post" action="soo.php?act=rules_adm_ok&soo='.$soo.'">';
echo 'Правила:<br/><input type="text" name="name" value="'.htmlspecialchars(stripslashes($comm['rules'])).'" maxlength="256"/><br/>';
echo '</select><br/>';
echo '<input type="submit" name="save" value="Сохранить"/></form>';
}
break;
case'rules_adm_ok':
$soo=trim($_GET['soo']);
$name=trim($_POST['name']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
mysql_query("UPDATE `community_comm` SET `rules` = '$name'");
mysql_query("OPTIMIZE TABLE `community_comm`");
print'Успешно<br/>';
}
break;
case'adm_soo':
$soo=trim($_GET['soo']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
if(!isset($us)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
echo '<form method="post" action="soo.php?act=adm_soo_ok&soo='.$soo.'">';
echo 'Название:<br/><input type="text" name="name" value="'.htmlspecialchars(stripslashes($comm['name'])).'" maxlength="100"/><br/>';
echo 'Описание:<br/><input type="text" name="about" value="'.htmlspecialchars(stripslashes($comm['about'])).'" maxlength="256"/><br/>';
echo 'Слоган:<br/><input type="text" name="slogan" value="'.htmlspecialchars(stripslashes($comm['slogan'])).'" maxlength="100"/><br/>';
echo 'Статус сообщества:<br/><select name="status">';
if($comm['status']==1){
$sel=' selected="selected"';
}else{
$sel=NULL;
}
echo '<option value="1"'.$sel.'>Отрыт для чтения</option>';
if($comm['status']==2){
$sel=' selected="selected"';
}else{
$sel=NULL;
}
echo '<option value="2"'.$sel.'>Закрыт для чтения</option>';
echo '</select><br/>';
echo '<input type="submit" name="save" value="Сохранить"/></form>';
echo '» <a href="/index.php?page=mysoo&id='.$soo.'">В сообщество</a><br/>';
}
break;
case'adm_soo_ok':
$soo=trim($_GET['soo']);
$name=trim($_POST['name']);
$about=trim($_POST['about']);
$slogan=trim($_POST['slogan']);
$status=trim($_POST['status']);
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
if(!isset($user)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
mysql_query("UPDATE `community_comm` SET `name` = '$name', `about` = '$about', `slogan` ='$slogan', `status` ='$status' WHERE `id` = '".$soo."'");
mysql_query("OPTIMIZE TABLE `community_comm`");
print'Успешно<br/>';
echo '» <a href="/soo/'.$soo.'">В сообщество</a><br/>';
}
break;
case 'adm_news':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
if(!isset($user)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
if (empty($news)){
echo '<a href="?act=adm_news_add&soo='.$soo.'">Добавить новость</a><dt></dt>';
if (empty($user['max'])) $user['max']=10;
$max = $user['max'];
$k_post=$db->sql_fetchfield($db->sql_query("select count(*) as num from comm_news where comm_id = '".$soo."'"),0);
$k_page=k_page($k_post,$max);
$page=page($k_page);
$start=$max*$page-$max;
$r = $db->sql_query ("Select * from comm_news where comm_id = '".$soo."' order by time desc LIMIT $start, $max");
if ($k_post == 0)echo 'Новостей нет<br />';
$post_k=$start+1;
while($a = @$db->sql_fetchrow($r)){
echo links.''.nik($a['user_id']).' ('.times($a['time']).') <a href="?act=adm_news_del&soo='.$soo.'&delk='.$a['id'].'">[Удал]</a>|<a href="?act=adm_news_edit&soo='.$soo.'&new='.$a['id'].'">[Изм]</a>'.div;
echo text($a['msg']);
echo '<dl></dl>';
}
if ($k_page>1){
echo "<dl><dt></dt></dl>";
str('?mod='.$mod.'&gid='.$gid.'&',$k_page,$page); // Вывод страниц
echo "<br /><dl><dt></dt></dl><br />";
}
}else if($news=='add'){
$msg = check($_POST['msg']);
if (empty($msg)){
if ($ver!='wml'){echo '<form action="?mod='.$mod.'&gid='.$gid.'&act='.$act.'&'.SID.'" method="post">';
echo'Новость:<br /><textarea cols="'.$user['pole2'].'" rows="'.$user['pole1'].'" name="msg" ></textarea><br />';echo '<br /><input type="submit" class="ibutton" value="Добавить"/></form><br /><br />';
}else{
echo 'Новость:<br /><input name="msg'.$ref.'" title="Новость"/><br/>';
echo '<br /><anchor title="go">Добавить<go href="?mod='.$mod.'&gid='.$gid.'&act='.$act.'&'.SID.'" method="post">';
echo '<postfield name="msg" value="$msg'.$ref.'"/></go></anchor><br/>';
}
}else{
if (strlen2($msg)<5){echo 'Новость слишком короткая!'; exit;}
if ($user['translit']==1)$msg = translit($msg);
if ($db->sql_query ("INSERT INTO group_news (gid,user_id,time,msg) VALUES ('$gid','$user[id]','$time','$msg')")){header ('Location: ?mod='.$mod.'&gid='.$gid.'&'.SID); exit;
}else echo 'Ошибка!<br />';
}
}
}
break;
case 'adm_news_add':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
if(!isset($user)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
$msg = check($_POST['msg']);
if (empty($msg)){
if ($ver!='wml'){echo '<form action="soo.php?act=adm_news_add&soo='.$soo.'&'.SID.'" method="post">';
echo'Новость:<br /><textarea cols="'.$user['pole2'].'" rows="'.$user['pole1'].'" name="msg" ></textarea><br />';echo '<br /><input type="submit" class="ibutton" value="Добавить"/></form><br /><br />';
}else{
echo 'Новость:<br /><input name="msg'.$ref.'" title="Новость"/><br/>';
echo '<br /><anchor title="go">Добавить<go href="soo.php?act=adm_news_add&soo='.$soo.'&act='.$act.'&'.SID.'" method="post">';
echo '<postfield name="msg" value="$msg'.$ref.'"/></go></anchor><br/>';
}
}else{
if (strlen2($msg)<5){echo 'Новость слишком короткая!'; exit;}
if ($user['translit']==1)$msg = translit($msg);
if ($db->sql_query ("INSERT INTO comm_news (comm_id,user_id,time,msg) VALUES ('$soo','$user[id]','$time','$msg')")){header ('Location: ?act=adm_news&soo='.$soo.'&'.SID); exit;
}else echo 'Ошибка!<br />';
}
}
break;
case 'adm_news_edit':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
if(!isset($user)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
echo '<div class="err">Доступ закрыт</div>';
}else if(mysql_result(mysql_query("SELECT COUNT(*) FROM `comm_ban` WHERE `id_user` = '$us[id]' AND `id_comm` = '$soo' AND `time` > '$time'"), 0)!=0){
header('Location: ban.php?id='.$soo);
}else{
$msg = check($_POST['msg']);
$new = check(intval($_GET['new']));
if (empty($msg)){
$a = @$db->sql_fetchrow($db->sql_query ("Select * from comm_news where id = '".$new."' and comm_id = '".$soo."'"));
if ($ver!='wml'){echo '<form action="soo.php?act=adm_news_edit&soo='.$soo.'&new='.$new.'&'.SID.'" method="post">';
echo'Новость:<br /><textarea cols="'.$user['pole2'].'" rows="'.$user['pole1'].'" name="msg" >'.text($a[msg],false,true,false,false,false).'</textarea><br />';echo '<br /><input type="submit" class="ibutton" value="Изменить"/></form><br /><br />';
}else{
echo 'Новость:<br /><input name="msg'.$ref.'" value="'.text($a[msg],false,true,false,false,false).'" title="Новость"/><br/>';
echo '<br /><anchor title="go">Изменить<go href="soo.php?act=adm_news_edit&soo='.$soo.'&new='.$new.'&'.SID.'" method="post">';
echo '<postfield name="msg" value="$msg'.$ref.'"/></go></anchor><br/>';
}
}else {
$msg = check($_POST['msg']);
if (strlen2($msg)<5){echo 'Новость слишком короткая!'; exit;}
if ($user['translit']==1)$msg = translit($msg);
if ($db->sql_query("UPDATE `comm_news` SET `msg` = '$msg' WHERE `id` = '".$new."' and comm_id = '".$soo."'")){header ('Location: ?act=adm_news&soo='.$soo.'&'.SID); exit;
}else echo 'Ошибка!<br />';
}
}
break;
case'adm_news_del':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
if(!isset($user)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
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{
if (isset($_GET['delk'])){
$db->sql_query("DELETE FROM `comm_news` WHERE `id` = '".check(intval($_GET['delk']))."' and comm_id = '".$soo."'");
$db->sql_query("DELETE FROM `comm_newskom` WHERE `new` = '".check(intval($_GET['delk']))."' and comm_id = '".$soo."'");
header ('Location: ?act=adm_news&soo='.$soo.'&'.SID); exit;
}
}
break;
case'user':
$id=trim($_GET['id']);
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$us['id']."'"));
$url = mysql_result(mysql_query("SELECT `name` FROM `community_comm` WHERE `id` = '".$soo."' LIMIT 1"),0);
echo '<div class="r-1"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b><b class="r1"></b><div class="header">Сообщество '.$url.'</div><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></div>';
echo '<div class="m-1"><b class="m4"></b><b class="m3"></b><b class="m2"></b><b class="m1"></b><b class="m1"></b><div class="mn">';
$comm_id = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$s = mysql_result(mysql_query('SELECT COUNT(id) FROM `users` WHERE `id` = '.$id.' LIMIT 1'),0);
if($s==0){
header("Location: /index.php");
exit;
}
$login = mysql_result(mysql_query("SELECT `login` FROM `users` WHERE `id` = '".$id."' LIMIT 1"),0);
if($id==0 || $id<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else{
echo '<b>'.$login.'</b> входит в сообщества:<br/>';
$total = mysql_num_rows(mysql_query("SELECT `id` FROM `community_user_incomm` WHERE `uid` = '".$id."'"));
if ($total > 0)
{
$col = 10;
$page_all = ceil($total / $col);
$page = isset($_GET['p']) ? (int)$_GET['p'] : 1;
if ($page < 1) $page = 1;
if ($page > $page_all) $page = $page_all;
$start = ($page * $col) - $col;
if (!preg_match('#^[0-9]{1,3}$#i', $page)) $page = 1;
$query=mysql_query("SELECT * FROM `community_user_incomm` WHERE `uid` = '".$id."' ORDER BY `time` DESC LIMIT ".$start.", ".$col);
while ($row = mysql_fetch_array($query))
{
$name_comm = mysql_fetch_array(mysql_query("SELECT * FROM `community_comm` WHERE `id` = '$row[cid]' LIMIT 1"));
echo '<div>- <a href="'.$_SERVER['PHP_SELF'].'?page=mysoo&id='.$row['cid'].'">'.htmlspecialchars(stripslashes($name_comm['name'])).'</a>['.date("d.m H:i", $row['time']).']
<br/></div>';
echo 'Статус в сообществе: ';
if($row['priv']==0){
echo 'Пользователь<br/>';
}else if($row['priv']==1){
echo 'Модератор<br/>';
}else if($row['priv']==2){
echo 'Администратор<br/>';
}
}
$url_page = $_SERVER['PHP_SELF'].'?page=mysoo&act=user&';
page($total, $page, $url_page, $page_all);
} else echo '<div>Обитатель не входит ни в одно сообщество!</div>';
}
break;
case 'news':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
if(!isset($user)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else 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{
if (empty($user['max'])) $user['max']=10;
$max = $user['max'];
$k_post=$db->sql_fetchfield($db->sql_query("select count(*) as num from comm_news where comm_id = '".$soo."'"),0);
$k_page=k_page($k_post,$max);
$page=page($k_page);
$start=$max*$page-$max;
$r = $db->sql_query ("Select * from comm_news where comm_id = '".$soo."' order by time desc LIMIT $start, $max");
if ($k_post == 0)echo 'Новостей нет<br />';
$post_k=$start+1;
while($a = @$db->sql_fetchrow($r)){
echo links.''.nik($a[user_id]).' ('.times($a['time']).')'.div;
echo text($a[msg]);
echo '<br /><a href="soo.php?act=newskomm&new='.$a[id].'&soo='.$soo.'">Комментарии</a>('.$db->sql_fetchfield($db->sql_query("select count(*) as num from comm_newskom where new = '".$a[id]."' and comm_id = '".$soo."'"),0).')';
echo '<dl></dl>';
}
if ($k_page>1){
echo "<dl><dt></dt></dl>";
str('?mod='.$mod.'&gid='.$gid.'&',$k_page,$page); // Вывод страниц
echo "<br /><dl><dt></dt></dl><br />";
}
}
break;
case 'newskomm':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
if(!isset($user)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else 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{
$new = check(intval($_GET['new']));
if (isset($_GET['delk'])){
if($admin['priv']==2){
$db->sql_query("DELETE FROM `comm_newskom` WHERE `id` = '".check(intval($_GET['delk']))."' and comm_id = '".$soo."'");
}
header ('Location: soo.php?act=newskomm&new='.$new.'&soo='.$soo.'&'.SID); exit;
}
if (isset($_POST['msg'])){
if (strlen2($_POST['msg'])>3){
if ($user['translit']==1)$_POST['msg'] = translit($_POST['msg']);
if ($db->sql_query ("INSERT INTO comm_newskom (comm_id,new,user_id,time,msg) VALUES ('$soo','$new','$user[id]','$time','".check($_POST['msg'])."')")){header ('Location: ?mod='.$mod.'&new='.$new.'&gid='.$gid.'&'.SID); exit;
}else echo 'Ошибка!<br />';
}
}
if (empty($user['max'])) $user['max']=10;
$max = $user['max'];
$k_post=$db->sql_fetchfield($db->sql_query("select count(*) as num from group_newskom where new = '".$new."' and gid = '".$gid."'"),0);
$k_page=k_page($k_post,$max);
$page=page($k_page);
$start=$max*$page-$max;
$r = $db->sql_query ("Select * from comm_newskom where new = '".$new."' and comm_id = '".$soo."' order by time desc LIMIT $start, $max");
if ($k_post == 0)echo 'Комментариев нет<br />';
$post_k=$start+1;
while($a = @$db->sql_fetchrow($r)){
echo links.''.nik($a[user_id]).'';
if($admin['priv']==2)echo '<small><a href="soo.php?act=newskomm&new='.$new.'&soo='.$soo.'&delk='.$a['id'].'">[X]</a></small>';
echo '('.times($a['time']).')'.div;
echo text($a[msg]);
echo '<dl></dl>';
}
if ($k_page>1){
echo "<dl><dt></dt></dl>";
str('?mod=komm&new='.$new.'&gid='.$gid.'&',$k_page,$page); // Вывод страниц
echo "<br /><dl><dt></dt></dl><br />";
}
echo '» <a href="soo.php?act=add_komm_news&soo='.$soo.'&new='.$new.'">Добавить</a><br/>';
}
break;
case 'add_komm_news':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
if(!isset($user)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else 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{
$new = check(intval($_GET['new']));
if (isset($_POST['msg'])){
if (strlen2($_POST['msg'])>3){
if ($user['translit']==1)$_POST['msg'] = translit($_POST['msg']);
if ($db->sql_query ("INSERT INTO comm_newskom (comm_id,new,user_id,time,msg) VALUES ('$soo','$new','$user[id]','$time','".check($_POST['msg'])."')")){header ('Location: soo.php?act=newskomm&new='.$new.'&soo='.$soo.'&'.SID); exit;
}else echo 'Ошибка!<br />';
}
}else{
if ($ver!='wml')echo '<form action="soo.php?act=add_komm_news&soo='.$soo.'&new='.$new.'&'.SID.'" method="post">';
if ($ver=='wml')echo '<br />Ваш комментарий:<br /><input name="msg'.$ref.'" maxlength="15" title="Text"/><br/>';
else echo '<br />Ваш комментарий:<br /><textarea cols="'.$user['pole2'].'" rows="'.$user['pole1'].'" name="msg"></textarea><br/><br />';
if ($ver=='wml'){
echo '<anchor title="go">Добавить<go href="soo.php?act=add_komm_news&soo='.$soo.'&new='.$new.'&'.SID.'" method="post">';
echo '<postfield name="msg" value="$msg'.$ref.'"/>
</go></anchor><br /><br />';
;
}else{
echo '<input type="submit" class="ibutton" value="Добавить"/></form><br /><br />';
}
}
}
break;
case 'icon':
$soo=trim($_GET['soo']);
$comm = mysql_fetch_array(mysql_query('SELECT * FROM `community_comm` WHERE `id` = '.$soo.' LIMIT 1'));
$admin = mysql_fetch_array(mysql_query("SELECT * FROM `community_user_incomm` WHERE `cid` = '$soo' AND `uid` = '".$user['id']."'"));
if(!isset($user)){
echo '<div class="err">Гостям вход запрещён.</div>';
}else if($soo==0 || $soo<0){
echo '<div class="err">Иди нахуй! Хакер недоношеный!</div>';
}else if($soo!=$comm['id']){
echo '<div class="err">Сообщество не найдено.</div>';
}else if($admin['priv']!=2){
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{
if (empty($mod)){
echo 'Размер загружаемого лого не должен привышать '.$set['s_gr_logo'].' кб. Форматы: gif, jpg, jpeg, png, bmp.<br/>';
if ($_GET['err']==1)echo '<b>Недопустимое расширение файла!</b><br />';
if ($_GET['err']==2)echo '<b>Размер файла не должен превышать '.$set['s_gr_logo'].' кб.</b><br />';
echo '<form ENCTYPE="multipart/form-data" action="soo.php?act=icon&mod=act1&soo='.$soo.'&'.SID.'" method="post">';
echo '<b>Прикрепить:</b><br/>';
echo '<INPUT NAME="file" TYPE="file" SIZE="20"><br/>
<input type="submit" class="ibutton" value="Отправить">
</form><br/>';
}else{
if(!isset($_FILES['file'])) $err = "<b>Вы не указали файл!</b><br/>";
$pictures = array('.gif', '.jpg', '.jpeg', '.bmp', '.png');
$ext = strtolower(strrchr($_FILES['file']['name'], '.'));
$fnames=$_FILES['file']['name']; //имя
if ((preg_match("/.php/i", $fnames)) or (preg_match("/.pl/i", $fnames)) or ($fnames == ".htaccess")){header ('Location: ?cat=icon&err=1&'.SID);exit;}
if(!in_array($ext, $pictures)){header ('Location: ?mod='.$mod.'&err=1&'.SID);exit;}
if($_FILES['file']['size'] > (1024 * $set['s_gr_logo'])) {header ('Location: ?act=icon&err=2&'.SID);exit;}
$logo = "files/groups/logo/".$gid.$ext."";
unlink (H.$user['photo'].'');
@copy($_FILES['file']['tmp_name'], H.$logo);
@chmod(H.basename($logo), 0644);
@$db->sql_query ("Update community_comm set logo='".$logo."' where id ='".$soo."'");
echo '<b>Логотип успешно загружен!</b>';
}
}
break;
}
echo '</div><b class="m1"></b><b class="m1"></b><b class="m2"></b><b class="m3"></b><b class="m4"></b></div>';
foot();
?>