Файл: world-faces.ru/world-faces.ru/news/index.php
Строк: 54
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../i.php';
only_reg();
$set['title']='Новости';
include_once '../sys/inc/thead.php';
title();
aut();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `news`"),0);
$k_page=k_page($k_post,3);
$page=page($k_page);
$start=3*$page-3;
$q=mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT $start, 3");
if ($k_post==0)
{
echo " <td class='dclass'>";
echo "Нет новостей";
echo " </div>";
}
while ($post = mysql_fetch_assoc($q)){
echo " <div class='prof'> <div class='phpmenu'> <div class='dclass'>";
echo "(".vremja($post['time']).")n";
echo output_text($post['msg'])."<br />n";
if ($post['link']!=NULL)echo "<a href='".htmlentities($post['link'], ENT_QUOTES, 'UTF-8')."'>Подробности</a><br />n";
echo "<a href='/news/komm.php?id=$post[id]'>Все комментарии</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_news` = '$post[id]'"),0).")";
$komms=mysql_query("SELECT * FROM `news_komm` WHERE `id_news` = '".$post['id']."' ORDER BY `id` DESC LIMIT 3");
while ($postkomm = mysql_fetch_array($komms)){
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $postkomm[id_user] LIMIT 1"));
if($num==1){ echo "<div class='adm'>";
$num=0;}
else
{echo "<div class='adm2'>";
$num=1;}
echo "<a href='/$ank[id]'><span style='color:$ank[ncolor]'>$ank[nick]</span></a> (".vremja($postkomm['time']).")n";
echo "<br>n";
echo "<span style='color:$ank[color]'>n";
echo output_text($postkomm['msg'])."<br />n";
echo "</span>n";
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
echo "<a href='/news/delete.php?id=$postkomm[id]'>Удалить</a><br />n";
echo "</div>n";
}
echo " </div></div> </div><hr>";
}
if ($k_page>1)str('index.php?',$k_page,$page);
include_once '../sys/inc/tfoot.php';
?>'