Размер файла: 1.22Kb
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.pp.ua *
**********************************/
$locate = 'in_forum';
$f_id = abs(intval($_GET['f_id']));
if($user['level'] < '6' || !isset($f_id)) { go('/'); }
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);
$db->query("INSERT INTO `forum_c`(`name`, `f_id`) VALUES('".$name."', '". abs(intval($f_id))."')");
go('/forum/'. $f_id);
}
$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/>
<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');
?>