Файл: modules/forum/add_forum.php
Строк: 44
<?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_forum';
if(User::level() < '6') { redirect('/'); exit;}
if(isset($_POST['create']) && $_GET['act'] == 'create') {
$name = substr(input($_POST['name']), 0, 90);
$desc = substr(input($_POST['desc']), 0, 160);
$db->query("INSERT INTO `forum`(`name`, `desc`, `pos`) VALUES('".$name."', '$desc', 0)");
redirect('/forum/');
}
$title = _t('create_forum');
include_header($title);
$tpl->div('title', _t('create_forum'));
echo '<form action="/forum/add_forum/?act=create" method="post">
<div class="menu">
<b>'. _t('name') .'</b>:<br/>
<input name="name" type="text" /><br/>
<b>'. _t('desc') .'</b>:<br/>
<input name="desc" type="text" /><br/>
<input name="create" type="submit" value="'. _t('create') .'" /><br/>
</div>
</form>';
$tpl->div('block', NAV .'<a href="/forum/">'. _t('forum') .'</a><br/>' . HICO .'<a href="/">'. _t('home').'</a>');
include_footer();
?>