Файл: mylaf.ru/group/group.php
Строк: 90
<?
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';
$id=intval($_GET['id']);
$group=mysql_fetch_assoc(mysql_query("SELECT * FROM `group` WHERE `id` = '$id'"));
if ($group['id']==0)header("location:/index.php");
$guser=mysql_fetch_assoc(mysql_query("SELECT * FROM `group_user` WHERE `id_group` = '$group[id]'"));
$adm=mysql_fetch_assoc(mysql_query("SELECT * FROM `group_user` WHERE `id_group` = '$group[id]' AND `level` = '2'"));
$us=get_user($guser['id_user']);
$admin=get_user($adm['id_user']);
$set['title']='Группа '.htmlspecialchars($group['name']);
$count=mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]'"), 0);
$count_news=mysql_result(mysql_query("SELECT COUNT(*) FROM `group_news` WHERE `id_group` = '$group[id]'"), 0);
if (isset($_GET['delok'])){
mysql_query("DELETE FROM `group_user` WHERE `id_group` = '$group[id]'");
mysql_query("DELETE FROM `group_news` WHERE `id_group` = '$group[id]'");
mysql_query("DELETE FROM `group` WHERE `id` = '$group[id]'");
header("Location: index.php?id=$user[id]&message");
exit;
}
include_once '../sys/inc/thead.php';
title();
if ($user['id']==$admin['id']){
if (isset($_GET['ok'])) include_once 'inc/ava_act.php';
}
err();
aut();
$d="<div class='gmenu'>";
$di="</div>";
echo "<center><b>".htmlspecialchars($group['name'])."</b><br/>";
echo "<center><input type='text' value='".$_SERVER['HTTP_HOST']."/club$group[id]'></center>";
ava128($group['id']);
echo "</center>";
if ($user['id']==$admin['id']){
if (isset($_GET['ok'])){
include_once 'inc/ava_form.php';
include_once '../sys/inc/tfoot.php';
}else echo "<a href='/group/group.php?id=$group[id]&ok'>$d Добавить логотип$di</a>";
}else echo "<br/>";
echo "<div class='forum'>";
echo "".htmlspecialchars($group['opis'])."";
if (isset($_GET['del'])){
if ($user['id']==$admin['id']){
echo "<div class='err'>";
echo "Вы действительно желаете удалить группу?<br/>";
echo "<a style='padding:4px;display:inline-block;' href='group.php?id=$group[id]&delok'>Да</a> <a style='padding:4px;display:inline-block;' href='group.php?id=$group[id]'>Нет</a>";
echo "</div>";
}
}
if ($user['id']==$admin['id']) echo " | <a href='/group/group.edit.php?id=$group[id]'>Ред.</a> <a href='/group/group.php?id=$group[id]&del'>Удл.</a>";
echo "<br/>Создана ".vremja($group['time'])."<br/>";
$adm=mysql_fetch_assoc(mysql_query("SELECT * FROM `group_user` WHERE `id_group` = '$group[id]' AND `level` = '2'"));
$ank=get_user($adm['id_user']);
echo "<b>Админ: </b>";
echo "".us($ank['id'])."";
echo "$di";
$user_v = mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_user` = '$user[id]' AND `id_group` = '$group[id]' LIMIT 1");
echo "<a href='/group/group.user.php?id=$group[id]'>$d Участники $count $di</a>";
if (isset($user)){
if (mysql_result($user_v, 0)==0){
if ($group['close']==0) echo "<a href='/group/group.act.php?group=$group[id]&ok'>$d Вступить в группу $di</a>";
}else echo "<a href='/group/group.act.php?group=$group[id]&no'>$d Покинуть группу $di</a>";
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `id_group` = '$group[id]' AND `id_user`='$user[id]' LIMIT 1"),0)==1){
echo "<a href='/group/ratting.group.php?id=$group[id]'><div class='gmenu'>Рейтинг группы $group[ratting]</div></a>";
}
echo "<div class='gmenu'>Новости группы $count_news</div>";
include_once 'inc/group.news.php';
include_once '../sys/inc/tfoot.php';
?>