Файл: forum/inc/set_forum_form.php
Строк: 51
<?php
if (isset($_POST['otmena'])) {
header("Location: /forum/$forum[id]/" . SID);
exit;
}
if (user_access('forum_razd_create') && (isset($_GET['act']) && $_GET['act'] == 'new' || !isset($_GET['act']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_r` WHERE `id_forum` = '$forum[id]'"), 0) == 0)) {
echo "<form class = 'foot' method = 'POST' action = '/forum/$forum[id]/?act=new&ok'>";
echo "Название раздела<br />";
echo "<input name = 'name' type = 'text' maxlength = '32' value = '' /><br />";
echo "<input value = 'Создать' type = 'submit' />";
echo "<input type = 'submit' name = 'otmena' value = 'Отмена' />";
echo "</form>";
}
if (user_access('forum_for_edit') && (isset($_GET['act']) && $_GET['act'] == 'set')) {
echo "<form class = 'foot' name = 'message' method = 'POST' action = '/forum/$forum[id]/?act=set&ok'>";
echo "Название форума<br />";
echo "<input name = 'name' type = 'text' maxlength = '32' value = '$forum[name]' /><br />";
echo "Описание<br />";
echo text::auto_bb("message", "opis");
echo L . "<textarea name = 'opis'>" . esc(trim(stripcslashes(htmlspecialchars($forum['opis'])))) . "</textarea><br />";
echo "Позиция<br /><input size = '3' name = 'pos' type = 'text' maxlength = '3' value = '$forum[pos]' /><br />";
if ($user['level'] >= 3) {
if ($forum['adm'] == 1) {
$check = ' checked = "checked"';
} else {
$check = NULL;
}
echo "<label><input type = 'checkbox'$check name = 'adm' value = '1' /> Только для администрации</label><br />";
}
echo "<input value = 'Изменить' type = 'submit' />n";
echo "<input type = 'submit' name = 'otmena' value = 'Отмена' />";
echo "</form>";
}
if (isset($_GET['act']) && $_GET['act'] == 'del' && user_access('forum_for_delete')) {
echo "<form class = 'foot' name = 'name' method = 'POST' action = '/forum/$forum[id]/?act=delete&ok'>";
echo "Подтвердите удаление форума [$forum[name]]<br />";
echo "<img src = '/captcha.php?SESS=$sess' width = '100' height = '30' alt = 'Проверочное число' /><br />";
echo "<input name = 'chislo' size = '5' maxlength = '5' value = '' type = 'text' /><br />";
echo "<input value = 'Да, удалить' type = 'submit' />n";
echo "<input type = 'submit' name = 'otmena' value = 'Отмена' />";
echo "</form>";
}
if (user_access('forum_razd_create') || user_access('forum_for_edit') || user_access('forum_for_delete')) {
echo "<div class = 'foot'>";
if (user_access('forum_razd_create')) {
echo "<img src = '/style/icons/page_white_add.png' /> <a href = '/forum/$forum[id]/?act=new'>Новый раздел</a><br />";
}
if (user_access('forum_for_edit')) {
echo "<img src = '/style/icons/page_white_edit.png' /> <a href = '/forum/$forum[id]/?act=set'>Изменить подфорум</a><br />";
}
if (user_access('forum_for_delete')) {
echo "<img src = '/style/icons/page_white_delete.png' /> <a href = '/forum/$forum[id]/?act=del'>Удалить подфорум</a><br />";
}
echo "</div>";
}