Файл: forum/inc/set_them_form.php
Строк: 96
<?php
/*
* Форум
* DCMS Special
* Модифицировал densnet
* Файл set_them_form.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 = 'razd' 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 = 'razd'>";
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 = 'razd clear_fix'>";
echo "<div class = 'dropdown'>";
echo "<a href = '#' class = 'button'><span class = 'icon icon96' /><span class = 'label'>Администрирование</span><span class = 'toggle'></span></a>";
echo "<div class = 'dropdown-slider'>";
if ((!isset($_GET['act']) || $_GET['act'] != 'post_delete') && (user_access('forum_post_ed') || isset($user) && $ank2['id'] == $user['id'])) {
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=post_delete' class = 'ddm'><span class = 'icon icon3' /><span class = 'label'>Удаление постов</span></a>";
}
if ((user_access('forum_them_edit') && $ank2['level'] < $user['level']) || $ank2['id'] == $user['id']) {
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=mesto' class = 'ddm'><span class = 'icon icon3' /><span class = 'label'>Переместить тему</span></a>";
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=set' class = 'ddm'><span class = 'icon icon3' /><span class = 'label'>Параметры темы</span></a>";
}
if (user_access('forum_them_del') && ($ank2['level'] < $user['level'] || $ank2['id'] == $user['id'])) {
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?act=del' class = 'ddm'><span class = 'icon icon3' /><span class = 'label'>Удалить тему</span></a>";
}
echo "</div></div></div>";
}