Просмотр файла comm/comm_guest.php

Размер файла: 2.83Kb
<?
include_once '../sys/inc/start.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';

//if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `community_comm` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"),0)==1)
//{

$id=$_GET['id'];

$g = mysql_fetch_array(mysql_query("SELECT * FROM `group` WHERE `id` = '$id'  LIMIT 1"));

if (isset($_GET['del']) && isset($user))
{
$set['title'] = 'Удаление поста';
include_once '../sys/inc/thead.php';
title();
aut();
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4)){
mysql_query("DELETE FROM `group_board` WHERE `id` = '".intval($_GET['del'])."' LIMIT 1");
echo'Пост успешно удалён!<br>';
echo'<a href="comm_guest.php?id='.$id.'"><b>В сообщество</b></a>';
}else{echo'Иди погуляй в песочницу :)';}
include_once '../sys/inc/tfoot.php';
exit;
}


$set['title'] = 'Гостевая сообщество '.$g['name'];
include_once '../sys/inc/thead.php';

title();
aut();
$comm = mysql_fetch_array(mysql_query("SELECT * FROM `community_comm` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
//////////////////////////////////////
echo "<div class=\"str\">\n";
echo '<a href="index.php?">Сообщества</a> &gt; <a href="comm.php?id='.intval($_GET['id']).'">'.$comm['name'].'</a> &gt; Гостевая сообществa<br />';
echo "</div>\n";
//////////////////////////////////////
$k_m=mysql_result(mysql_query("SELECT COUNT(*) FROM `group_board` WHERE `g` = '$id'"), 0);
$k_page=k_page($k_m,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];


if ($k_m == '0')echo 'Нет сообщений<br/>';

$q = mysql_query("SELECT * FROM `group_board` WHERE `g` = '$id' ORDER BY time DESC LIMIT $start, $set[p_str]");
while ($p = mysql_fetch_array($q))
{
$a = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $p[user] LIMIT 1"));
if($num==1){ 
echo "<div class='news'>\n";
$num=0;
}else{ 
echo "<div class='str'>\n";
$num=1;}

echo "".$inf.online($p['user'])."\n";
echo '<a href="/info.php?id='.$a['id'].'">'.$a['nick'].'</a>';
echo "  (".vremja($p['time']).")\n";
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
	echo "[<a href='comm_guest.php?id=".$id."&amp;del=".$p['id']."'><b>X</b></a>]";
echo "<br/>\n";
echo esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($p['msg']))))))))."\n";

echo "</div>\n";
}

//}

if ($k_page>1)str("?id=$id&",$k_page,$page);
echo '- <a href="board_add.php?id='.$id.'">Написать</a>';

include_once '../sys/inc/tfoot.php';
?>