View file modules/lenta/index.php

File size: 1.88Kb
<?php

require_once(HOME .'/incfiles/header.php');

$lentacount = mysql_result(mysql_query("SELECT COUNT(*) FROM `lenta`"), 0);        
if ($user['id']>=1){
$user_obj=$user['object'];
}
else {
$user_obj="6";
}
nav_start($lentacount,$user_obj);

if ($lentacount==0){
echo '<div class="title">Лента</div>';
echo '<div class="menu">В ленте нет событий =(</div>';}
else {

$newss = mysql_query(" SELECT * FROM `lenta` ORDER BY `id` DESC LIMIT $start,$user_obj");
while($news = mysql_fetch_assoc($newss)){
$news_autor = $news['autor'];
$news_id = $news['id'];
$news_time = $news['time'];
$news_text = $news['text'];
$news_name = $news['name'];
$postcount = mysql_result(mysql_query("SELECT COUNT(*) FROM `newscomm` WHERE `news` = '".$news_id."'"), 0);
if ($user['level']==2){
echo '<div class="title">'.output($news_name).' ('.output(vtime($news_time)).')</div>';
echo '<div class="menu">'.output(smiles($news_text)).'
<br />
Добавил:<a href="/user/user.php?login='.output($news_autor).'">'.output($news_autor).'</a><br />
<img src="/design/icons/comment.png"><a href="/lenta/comm.php?news='.output($news_id).'"> Обсудить</a> <b>('.$postcount.')</b>
<br />
<a href="/lenta/dell.php?post_id='. $news['id'] .'"> Удл.</a>
</div>';
}
else {
echo '<div class="title">'.output($news_name).'  ('.output(vtime($news_time)).')</div>';
echo '<div class="menu">'.output(smiles($news_text)).'
<br />
Добавил:<a href="/user/user.php?login='.output($news_autor).'">'.output($news_autor).'</a><br />
<img src="/design/icons/comment.png"><a href="/lenta/comm.php?news='.output($news_id).'"> Обсудить</a> <b>('.$postcount.')</b>


</div>';

}



}





view_nav(); 
 }     
echo '<div class="block">
&raquo; <a href="/">На главную</a>
</div>';

# Ноги модуля
require_once(HOME .'/incfiles/footer.php');

?>