Файл: modules/news/comments.php
Строк: 61
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$locate = 'in_news';
$news_id = abs(intval($_GET['id']));
$news_t = $db->query("SELECT * FROM `news` WHERE `id` = '". $news_id ."'")->fetch();
if(User::logged())
{
$db->query("UPDATE `notify` SET `read` = '1' WHERE `request_id` = '/news/comments/".$news_id."' AND `user_id` = '".User::Id()."' AND `type` = 'notify_comments_reply'");
}
$title = _t('comments') .' | '. $news_t['name'] .' | '._t('news');
include_header($title);
$tpl->div('title', _t('comments') .' | '. $news_t['name']);
if(User::logged())
{
$tpl->div('menu', '<a href="/news/add_comment?news_id='. $news_id .'">'. _t('add_comment') .'</a>');
}
$comments = new Comments('news', $news_id);
$comments->view();
$tpl->div('block', NEWS_ICON .' <a href="/news/">'. _t('news') .'</a><br/>' . HICO .' <a href="/">'. _t('home').'</a>');
include_footer();
?>