Файл: modules/news/article.php
Строк: 54
<?php
if(isset($user)) {
$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="title">Добавил новость<br/></div><div class="post">'.nick($news['user_id']) . ' ('.rtime($news['time']).')');
}
$tpl->div('block', img('reply_11.png') .'<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');
} else {
$title = 'Новости';
require_once(SYS.'/view/header.php');
$tpl->div('title', 'Новости');
$tpl->div('menu', '<center>Новости доступны только зарегистрированным пользователям!</center>');
$tpl->div('block',HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
}
?>