Размер файла: 1.7Kb
<?
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]");
$listing = new Smarty_conf();
$posts=array();
while ($post = mysql_fetch_assoc($q))
{
$msg=output_text($post['msg'])."<br />";
if ($post['link'])$msg.="<a href='".input_value_text($post['link'])."'>Подробности</a><br />\n";
$msg.= "<a href='komm.php?id=$post[id]'>Комментарии</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_news` = '$post[id]'"),0).")<br />\n";
$posts[]=array('title'=>$post['title'].' ('.vremja($post['time']).')',
'post' => $msg,
'icon' => array('size'=>'small','src'=>ICONS_COMMON.'news.png')
);
}
if (!$posts)$posts[]=array('title' => 'Новости отсутствуют');
$listing->assign('post',$posts);
$listing->display('body.conlentlist.tpl');
if ($k_page>1)str('index.php?',$k_page,$page); // Вывод страниц
echo '<hr color="DeepSkyBlue1" hr noshade size="1"></font>';
echo "«<a href='/love/index.php'>В знакомства</a><br/>\n";
include_once '../sys/inc/tfoot.php';
?>