<?
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';
$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,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT $start, $set[p_str]");
echo "<table class='post'>\n";
if ($k_post==0)
{
echo "   <tr>\n";
echo "  <td class='p_t'>\n";
echo "Нет новостей\n";
echo "  </td>\n";
echo "   </tr>\n";

}
while ($post = mysql_fetch_assoc($q))
{
echo "<table class='post'><tr><td class='icon14'>
<img src='/style/icons/mini_news.png'></td>
<td class='p_t'>
$post[title]</a> (".vremja($post['time']).")</td>
</tr></table>";
echo "<div class='wm'>\n";
echo output_text($post['msg'])."<br />\n";
echo "</div>\n";
echo "<div class='wm'>\n";
if ($news['link']!=NULL)echo "<a href='".htmlentities($post['link'], ENT_QUOTES, 'UTF-8')."'>Обсудить</a><br />\n";
echo "<img src='/style/icons/obs.png'> <a href='/news/komm.php?id=$post[id]'>Обсудить</a> | <a href='/news/'>Архив</a> [".mysql_result(mysql_query("SELECT COUNT(*) FROM `news` ",$db), 0)."]<br />\n";

echo "</div>\n";
}
echo "</table>\n";
if ($k_page>1)str('index.php?',$k_page,$page);
include_once '../sys/inc/tfoot.php';
?>
