<?
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();

if (mysql_result(mysql_query("SELECT COUNT(*) FROM `news` LIMIT 1",$db), 0)==0){header("Location: /index.php?".SID);exit;}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `news`"),0);
$set['p_str']=10;
$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]");
if ($k_post==0)
{
echo "Нет новостей\n";
}
while ($post = mysql_fetch_array($q))
{
echo "<table class='post'>\n";

echo '<tr><td class="gicon1">';
echo "<img src='/style/icon36/news.png' alt='' class='icon'/>\n";
echo '</td>';
if($num==1){
echo "  <td class='rer'>\n";
$num=0;
}else{
echo "  <td class='menu_razd'>\n";
$num=1;}
echo "<a href='/news/news.php?id=$post[id]'><font color='#db940b'><b>$post[title]</b></font></a><br/>\n";
echo "<font color='#fa9196'>".vremja($post['time'])."</font>\n";

echo '</td></tr>';

echo '</table>';

}


if ($k_page>1)str('index.php?',$k_page,$page); // Вывод страниц
include_once '../sys/inc/tfoot.php';
?>
