Вход Регистрация
Файл: public_html/modules/news/comments.php
Строк: 80
<?php
/**********************************
*    @package: PerfCMS              *
*    @year: 2012                      *
*    @author: Artas                  *
*    @link: http://perfcms.net     *
* ------------------------------- *
*    @package: PerfCMS Ultra          *
*    @year: 2013                      *
*   @author: wanya26ua & Tesla    *
*   @link: http://perfclub.ru     *
**********************************/
$locate 'in_news';
$news_id abs(intval($_GET['news_id']));
$id abs(intval($_GET['id']));
$news_t $db->query("SELECT * FROM `news` WHERE `id` = '"$news_id ."'")->fetch();

if(isset(
$_GET['act']) && $_GET['act'] == 'edit') {
if(isset(
$_POST['edit'])) {
if(!empty(
$_POST['text'])) {
$text substr(input($_POST['text']), 05000);
$db->query("UPDATE `news_comms` SET `text` = '"$text ."' WHERE `id` = '".abs(intval($_GET['id']))."'");
}
header('location: /news/'.$news_id.'/comments/');
exit;
}
$news_c $db->query("SELECT * FROM `news_comms` WHERE `id` = '"$id ."'")->fetch();
if((
$_GET['id'] != || !empty($_GET['id'])) && $user['level'] >= or $news_c['user_id'] == $user['id']) {
$title $lang->word('comments') .' | '$news_t['name'] .' | '.$lang->word('news');
require_once(
SYS.'/view/header.php');
$tpl->div('title'$lang->word('comments') .' | '$news_t['name']);
echo 
'<form action="" method="post">
        <div class="menu">
            <b>'
$lang->word('message') .'</b>:<br/>
            <textarea name="text" rows="5" cols="26">'
.$news_c['text'].'</textarea><br/>
            <input name="edit" type="submit" value="'
$lang->word('edit') .'" /><br/>
        </div>
        </form>'
;
$tpl->div('block'NAV .'<a href="/news/'.$news_id.'/comments/">'$lang->word('back') .'</a><br/>' HICO .'<a href="/">'$lang->word('home').'</a>');
require_once(
SYS.'/view/footer.php');        
exit;        
} else {
$tpl->div('error'$lang->word('chat_not_g')); }
}

$title $lang->word('comments') .' | '$news_t['name'] .' | '.$lang->word('news');
require_once(
SYS.'/view/header.php');
$tpl->div('title'$lang->word('comments') .' | '$news_t['name']);


if(isset(
$user))
{
$tpl->div('menu''<a href="/news/add_comment/?news_id='$news_id .'">'$lang->word('add_comment') .'</a>');
}
$comments = new Comments('news'$news_id);
$comments->view();
$tpl->div('block'NEWS_ICON .' <a href="/news/">'$lang->word('news') .'</a><br/>' HICO .' <a href="/">'$lang->word('home').'</a>');
require_once(
SYS.'/view/footer.php');
?>
Онлайн: 0
Реклама