Файл: modules/forum/action/close_theme.php
Строк: 97
<?php
/* DCMS Special
* Дата последнего редактирования 19.12.2015
* Модифицировал densnet
* Автор yadalay
*/
if (isset($_POST['close'])) {
$reason = mysql_real_escape_string(trim($_POST['reason']));
$cause = ($reason == NULL) ? 'неизвестна.' : '' . toOutput($reason);
$reason = "Тему " . ($user['sex'] ? 'закрыл' : 'закрыла') . " $user[nick]<br />Причина: " . $cause;
if (mb_strlen($reason) > 100) {
echo "<div class='alert alert-danger'>Слишком длинная причина. Максимум 100 символов.</div>";
} else {
$msg_sys = "[url=/info.php?id=$user[id]]$user[nick][/url] " . ($user['sex'] ? 'закрыл' : 'закрыла') . " тему. Причина указана выше.";
mysql_query('INSERT INTO `forum_posts` SET `id_theme` = ' . $theme->id . ', `id_user` = "0", `id_admin` = "0", `text` = "' . mysql_real_escape_string($msg_sys) . '", `time` = ' . $time);
mysql_query('UPDATE `forum_themes` SET `reason_close` = "' . mysql_real_escape_string(trim($reason)) . '" WHERE `id` = ' . $theme->id);
header('Location: ' . DIR_FORUM . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
}
} else {
#Навигация
echo "<nav class='navbar navbar-light' style='background-color: #607D8B; color: #fff;'>";
echo "<ul class='nav navbar-nav'>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='/'><i class='material-icons'>home</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='" . DIR_FORUM . "'>Форум</a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='" . DIR_FORUM . "$forum->id/'>" . toOutput($forum->name, 1, 1, 0, 0, 0) . "</a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='" . DIR_FORUM . "$forum->id/$razdel->id/'>" . toOutput($razdel->name, 1, 1, 0, 0, 0) . "</a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id.html'>" . toOutput($theme->name, 1, 0, 0, 0, 0) . "</a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'>Закрытие темы</a></li>";
echo "</ul>";
echo "</nav>";
echo "<form class='list-group-item' action='" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/close_theme.html' method='post'>";
echo "<div class='row'>";
echo "<div class='input-field col s12'>";
echo "<input id='reason' name='reason' length='100' type='text' value='' class='validate'>";
echo "<label for='reason'>Укажите причину</label>";
echo "</div>";
echo "</div>";
echo "<button name='close' class='btn waves-effect waves-light'><i class='material-icons'>lock</i> Закрыть тему</button>";
echo "</form>";
require_once H . 'sys/inc/tfoot.php';
exit;
}