Файл: modules/forum/action/actions_posts.php
Строк: 22
<?php
/* DCMS S (Special)
 * Версия файла 0.0.1
 * Дата последнего редактирования 13.11.2015
 * Модифицировал densnet
 * Автор yadalay
 */
if (user::access('forum_post_ed')) {
    $d_posts = $_POST['act'];
    $count_p = count($d_posts);
    if ($count_p != 0) {
        for ($i = 0; $i < $count_p; $i++) {
            if (isset($_POST['delete_posts'])) {
                mysql_query('DELETE FROM `forum_posts` WHERE `id` = ' . intval($d_posts[$i]));
            } elseif (isset($_POST['hide_posts'])) {
                mysql_query('UPDATE `forum_posts` SET `hide` = "1", `id_admin` = ' . $user['id'] . ' WHERE `id` = ' . intval($d_posts[$i]));
            } elseif (isset($_POST['display_posts'])) {
                mysql_query('UPDATE `forum_posts` SET `hide` = "0", `id_admin` = "0" WHERE `id` = ' . intval($d_posts[$i]));
            }
        }
        if (isset($_POST['delete_posts'])) {
            msg('Успешно удалено ' . $count_p . ' пост(а/ов)');
            $msg_sys = '[url=/info.php?id=' . $user['id'] . ']' . $user['nick'] . '[/url] почистил тему. Было удалено ' . $count_p . ' пост(а/ов)';
            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);
        } elseif (isset($_POST['hide_posts'])) {
            msg('Успешно скрыто ' . $count_p . ' пост(а/ов)');
        } elseif (isset($_POST['display_posts'])) {
            msg('Успешно показано вновь ' . $count_p . ' пост(а/ов)');
        }
    } else {
        echo "<div class = 'alert alert-danger'>Выбрано 0 элементов. Удаление недоступно.</div>";
    }
}
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;