Файл: modules/forum/edit_forum.php
Строк: 36
<?php
$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, 90);
$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('form_album_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', img('forum.png') .'<a href="/forum/">'. $lang->word('forum') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
?>