Файл: modules/blog/comments.php
Строк: 48
<?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_blogs';
$blog_id = abs(intval($_GET['id']));
$blog_t = $db->query("SELECT * FROM `blogs` WHERE `id` = '". $blog_id ."'")->fetch();
if(User::logged())
{
$db->query("UPDATE `notify` SET `read` = '1' WHERE `request_id` = '/blog/comments/".$blog_id."' AND `user_id` = '".User::Id()."' AND `type` = 'notify_comments_reply'");
$db->query("UPDATE `notify` SET `read` = '1' WHERE `request_id` = '/blog/comments/".$blog_id."' AND `user_id` = '".User::Id()."' AND `type` = 'notify_blog_reply'");
}
$title = _t('comments') .' | '. $blog_t['name'] .' | '._t('blogs');
include_header($title);
$tpl->div('title', _t('comments') .' | '. $blog_t['name']);
if(User::logged())
{
$tpl->div('menu', '<a href="/blog/add_comment?blog_id='. $blog_id .'">'. _t('add_comment') .'</a>');
}
$comments = new Comments('blog', $blog_id, '', 'blog', 'blogs');
$comments->view();
$tpl->div('block', NAV .' <a href="/blog/note/'.$blog_id.'">'. _t('back') .'</a><br/>'. NAV .' <a href="/blog/">'. _t('blogs') .'</a><br/>' . HICO .' <a href="/">'. _t('home').'</a>');
include_footer();
?>