Файл: forum/inc/set_them_form.php
Строк: 72
<?php
if (isset($_POST['otmena'])) {
header("Location: /forum/$forum[id]/$razdel[id]/$them[id]/" . SID);
exit;
}
if (isset($_GET['act']) && $_GET['act'] == 'mesto' && (user_access('forum_them_edit') || $ank2['id'] == $user['id'])) {
echo "<form class = 'foot' name = 'name' method = 'POST' action = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=mesto&ok'>";
echo "Раздел:<br />";
echo "<select name = 'razdel'>n";
if (user_access('forum_them_edit')) {
$q = mysql_query("SELECT * FROM `forum_f` ORDER BY `pos` ASC");
while ($forums = mysql_fetch_assoc($q)) {
echo "<optgroup label = '$forums[name]'>n";
$q2 = mysql_query("SELECT * FROM `forum_r` WHERE `id_forum` = '$forums[id]' ORDER BY `time` DESC");
while ($razdels = mysql_fetch_assoc($q2)) {
echo "<option" . ($razdel['id'] == $razdels['id'] ? ' selected = "selected"' : null) . " value = '$razdels[id]'>$razdels[name]</option>n";
}
echo "</optgroup>";
}
} else {
$q2 = mysql_query("SELECT * FROM `forum_r` WHERE `id_forum` = '$forum[id]' ORDER BY `time` DESC");
while ($razdels = mysql_fetch_assoc($q2)) {
echo "<option" . ($razdel['id'] == $razdels['id'] ? ' selected = "selected"' : null) . " value = '$razdels[id]'>$razdels[name]</option>n";
}
}
echo "</select><br />";
echo "<input value = 'Переместить' type = 'submit' />";
echo "<input type = 'submit' name = 'otmena' value = 'Отмена' />";
echo "</form>";
}
if (isset($_GET['act']) && $_GET['act'] == 'set' && ((user_access('forum_them_edit') && $ank2['level'] < $user['level']) || $ank2['id'] == $user['id'])) {
echo "<form class = 'foot' name = 'name' method = 'POST' action = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=set&ok'>";
echo "Название темы:<br />";
echo "<input name = 'name' type = 'text' maxlength = '32' value = '$them[name]' /><br />";
if ($user['level'] > 0) {
if ($them['up'] == 1) {
$check = ' checked="checked"';
} else {
$check = NULL;
}
echo "<label><input type = 'checkbox'$check name = 'up' value = '1' /> Всегда наверху</label><br />";
}
if ($them['close'] == 1) {
$check = ' checked="checked"';
} else {
$check = NULL;
}
echo "<label><input type = 'checkbox'$check name ='close' value = '1' /> Закрыть</label><br />";
if ($ank2['id'] != $user['id']) {
echo "<label><input type = 'checkbox' name = 'autor' 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_them_del') && ($ank2['level'] < $user['level'] || $ank2['id'] == $user['id'])) {
echo "<div class = 'foot'>";
echo "Подтвердите удаление темы<br />";
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=delete&ok'>Да</a> | <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/'>Нет</a>";
echo "</div>";
}
if (isset($_GET['act']) && $_GET['act'] == 'post_delete' && (user_access('forum_post_ed') || (isset($user) && $ank2['id'] == $user['id']))) {
echo "<input value = 'Удалить выбранные посты' type = 'submit' />";
echo "<input type = 'submit' name = 'otmena' value = 'Отмена' />";
echo "</form>";
}
if (((!isset($_GET['act']) || $_GET['act'] != 'post_delete') && (user_access('forum_post_ed') || isset($user) && $ank2['id'] == $user['id'])) || ((user_access('forum_them_edit') && $ank2['level'] < $user['level']) || $ank2['id'] == $user['id']) || (user_access('forum_them_del') && ($ank2['level'] < $user['level'] || $ank2['id'] == $user['id']))) {
echo "<div class = 'foot'>";
if ((!isset($_GET['act']) || $_GET['act'] != 'post_delete') && (user_access('forum_post_ed') || isset($user) && $ank2['id'] == $user['id'])) {
echo "<img src = '/style/icons/page_white_code_red.png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=post_delete'>Удаление постов</a><br />";
}
if ((user_access('forum_them_edit') && $ank2['level'] < $user['level']) || $ank2['id'] == $user['id']) {
echo "<img src = '/style/icons/page_white_go.png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=mesto'>Переместить тему</a><br />";
echo "<img src = '/style/icons/page_white_edit.png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=set'>Изменить тему</a><br />";
}
if (user_access('forum_them_del') && ($ank2['level'] < $user['level'] || $ank2['id'] == $user['id'])) {
echo "<img src = '/style/icons/page_white_delete.png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=del'>Удалить тему</a><br />";
}
echo "</div>";
}