<?
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(); // форма авторизации
if (isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id']!=NULL)
{
$id_list=mysql_fetch_array(mysql_query("SELECT * FROM `news` WHERE `id` = ".intval($_GET['id'])." LIMIT 1"));


mysql_query("UPDATE `news` SET `prochit` = '".($id_list['prochit']+1)."' WHERE `id` = '$id_list[id]' LIMIT 1");
echo "<div class='msg'>";
echo "$id_list[title]\n";
echo "(".vremja($id_list['time']).")\n";
echo "</div>";
echo trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($id_list['msg'])))))))."<br />\n";
if ($id_list['link']!=NULL)echo "<a href='$id_list[link]'>Подробности</a><br />\n";
if ($id_list['prochit']!=NULL){
echo "Новость прочитана $id_list[prochit] раз(а)<br />";}else{echo "Новость прочитана 0 раз(а)<br />";}
echo "<a href='komm.php?id=$id_list[id]'>Комментарии</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_news` = '$id_list[id]'"),0).")<br />\n";
}

include_once '../sys/inc/tfoot.php';
?>
