File size: 1.33Kb
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.org.ua *
**********************************/
$locate = 'in_downloads';
if(!isset($user)) { go('/'); exit;}
if(!empty($_GET['downloads_id'])) {
if(isset($_POST['create']) && $_GET['act'] == 'create') {
$comments = new Comments('downloads_files', $_GET['downloads_id'], '', 'downloads', 'file');
$comments->add($_POST['text']);
}
$title = $lang->word('add_comment');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('add_comment'));
echo '<form action="/downloads/add_comment/?act=create&downloads_id='. abs(intval($_GET['downloads_id'])) .'" method="post">
<div class="menu">
<b>'. $lang->word('message') .'</b>:<br/>
<textarea name="text" rows="5" cols="26">'.(isset($_GET['reply_to']) ? '[b]'.tnick($_GET['reply_to']).'[/b], ' : NULL).'</textarea><br/>
<input name="create" type="submit" value="'. $lang->word('create') .'" /><br/>
</div>
</form>';
$tpl->div('block', NAV .'<a href="/downloads/'. abs(intval($_GET['downloads_id'])) .'/comments/">'. $lang->word('back') .'</a><br/>' . NAV .'<a href="/news/">'. $lang->word('news') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
} else { go('/'); }
?>