File size: 2.52Kb
<?php
require_once(HOME .'/incfiles/header.php');
echo '<div class="title">Лента|Обсуждение</div>';
if (!isset($lenta) && mysql_result(mysql_query("SELECT COUNT(*) FROM `lenta` WHERE `id` = '". num($_GET['news']) ."' LIMIT 1"), 0) == 0)
{
echo '<div class="menu">
Событие не существует!
</div>';
echo '<div class="block">
» <a href="/lenta/">В ленту</a></br>
» <a href="/">На главную</a>
</div>';
require_once(HOME .'/incfiles/footer.php');
}
else {
if ($user['id']>=1){
$user_obj=$user['object'];
}
else {
$user_obj="6";
}
if ($user['id']>0){echo '<div class="menu">
» <a href="/lenta/add.php?news='.$_GET['news'].'">Написать</a>
</div>';}
$postcount = mysql_result(mysql_query("SELECT COUNT(*) FROM `newscomm` WHERE `news` = '".$_GET['news']."'"), 0);
nav_start($postcount, $user_obj);
if ($postcount==0){echo '<div class="menu">Событие не обсуждалось!</div>';}
else {
$posts = mysql_query(" SELECT * FROM `newscomm` WHERE `news` = '".$_GET['news']."' ORDER BY `id` DESC LIMIT $start, $user_obj");
while($post = mysql_fetch_assoc($posts)){
$post_autor = $post['autor'];
$post_time = $post['time'];
$post_text = $post['text'];
if ($user['level']==2){
echo '<div class="menu"><a href="/user/user.php?login='.output($post_autor).'"><u>'.output($post_autor).'</u></a> ('.output(vtime($post_time)).')<br /><b> '.output(smiles($post_text)).'</b>
<br />
<a href="/lenta/add.php?reply='. $post['autor'] .'&news='.$_GET['news'].'"> Отв.</a>
<a href="/lenta/commdell.php?post_id='. $post['id'] .'"> Удл.</a>
</div>';
}
if ($user['level']==1){
echo '<div class="menu"><a href="/user/user.php?login='.output($post_autor).'"><u>'.output($post_autor).'</u></a>('.output(vtime($post_time)).') <br /><b> '.output(smiles($post_text)).'</b>
<br />
<a href="/lenta/add.php?reply='. $post['autor'] .'&news='.$_GET['news'].'"> Отв.</a>
</div>';
}
if ($user['id']<1){
echo '<div class="menu"><a href="/user/user.php?login='.output($post_autor).'"><u>'.output($post_autor).'</u></a> ('.output(vtime($post_time)).')<br /><b> '.output(smiles($post_text)).'</b>
</div>';
}
}
if ($user['id']>0){echo '<div class="menu">
» <a href="/lenta/add.php?news='.$_GET['news'].'">Написать</a>
</div>';}
view_nav('?news='. num($_GET['news']) .'&');
}
echo '<div class="block">
» <a href="/">На главную</a>
</div>';
# Ноги модуля
require_once(HOME .'/incfiles/footer.php');
}
?>