Размер файла: 1.22Kb
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.pp.ua *
**********************************/
$locate = 'in_news';
$news_id = abs(intval($_GET['news_id']));
$news_n = $db->query("SELECT * FROM `news` WHERE `id` = '". $news_id ."' LIMIT 1")->rowCount();
if($news_n == 0) { go('/news/'); exit;}
$news_t = $db->query("SELECT * FROM `news` WHERE `id` = '". $news_id ."' LIMIT 1")->fetch();
$title = $news_t['name'] .' | '.$lang->word('news');
require_once(SYS.'/view/header.php');
$tpl->div('title', $news_t['name']);
$news_q = $db->query("SELECT * FROM `news` WHERE `id` = '". $news_id ."' LIMIT 1");
while($news = $news_q->fetch()) {
$tpl->div('post', output($news['text']) .'<br/></div><div class="news">'.nick($news['user_id']) . ' <br/>('.rtime($news['time']).')');
}
$tpl->div('block', NAV .'<a href="/news/'. $news_id .'/comments/">'. $lang->word('comments') .'</a> ('. $db->query("SELECT * FROM `news_comms` WHERE `news_id` = '". $news_id ."'")->rowCount() .')<br/>' . NEWS_ICON .' <a href="/news/">'. $lang->word('news') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
?>