File size: 1.41Kb
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.ru *
**********************************/
$locate = 'in_forum';
$f_id = abs(intval($_GET['f_id']));
if($user['level'] < '6' || !isset($f_id)) { go('/'); exit;}
if($db->query("SELECT * FROM `forum` WHERE `id` = '". $f_id ."'")->rowCount() == 0) {
go('/forum/');
}
if(isset($_POST['create']) && $_GET['act'] == 'create') {
$name = substr(input($_POST['name']), 0, 45);
$descr = substr(input($_POST['desc']), 0, 160);
$db->query("INSERT INTO `forum_c`(`name`, `f_id`, `desc`) VALUES('".$name."', '". abs(intval($f_id))."', '".$descr."')");
go('/forum/'. $f_id);
// print_r($db->errorInfo());
}
$title = $lang->word('create_subforum');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('create_subforum'));
echo '<form action="/forum/add_subforum/'. $f_id .'/?act=create" method="post">
<div class="menu">
<b>'. $lang->word('name') .'</b>:<br/>
<input name="name" type="text" /><br/>
<b>'. $lang->word('desc') .'</b>:<br/>
<input name="desc" type="text" /><br/>
<input name="create" type="submit" value="'. $lang->word('create') .'" /><br/>
</div>
</form>';
$tpl->div('block', NAV .'<a href="/forum/">'. $lang->word('forum') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
?>