Файл: public_html/modules/forum/edit_forum.php
Строк: 39
<?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_forum';
if($user['level'] < '6' || !isset($_GET['f_id'])) { go('/'); exit;}
if($db->query("SELECT * FROM `forum` WHERE `id` = '".abs(intval($_GET['f_id']))."'")->rowCount() == 0) {
go('/forum/');
}
$edit_cat = $db->query("SELECT * FROM `forum` WHERE `id` = '".abs(intval($_GET['f_id']))."'")->fetch();
if(isset($_POST['edit']) && $_GET['act'] == 'edit') {
$name = substr(input($_POST['name']), 0, 99);
$desc = substr(input($_POST['desc']), 0, 160);
$db->query("UPDATE `forum` SET `name` = '". $name ."', `desc` = '$desc' WHERE `id` = '".abs(intval($_GET['f_id']))."'");
go('/forum/');
// print_r($db->errorInfo());
}
$title = $lang->word('edit');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('edit'));
echo '<form action="/forum/edit_forum/'.abs(intval($_GET['f_id'])).'/?act=edit" method="post">
<div class="menu">
<b>'. $lang->word('name') .'</b>:<br/>
<input typr="text" name="name" value="'. $edit_cat['name'] .'" /><br/>
<b>'. $lang->word('desc') .'</b>:<br/>
<input typr="text" name="desc" value="'. $edit_cat['desc'] .'" /><br/>
<input name="edit" type="submit" value="'. $lang->word('edit') .'" /><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');
?>