Файл: soc-set/moduls/forum/fix.php
Строк: 6
<?php
require_once('../../core/start.php');
check_auth();
$theme = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS_THEME." WHERE `id` = ? ", array(abs(num($_GET['theme']))));
if (empty($theme)) {
head('Тема не найдена');
echo DIV_TITLE . 'Тема не найдена' . CLOSE_DIV;
echo DIV_ERROR . 'Ошибка!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Главная</a> / <a href="'.HOME.'/forum/">Форум</a> / <b>Тема не найдена</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
if ( $theme['user_id'] != $user['user_id'] && privilegy('forum_moder') == FALSE ) {
head('Ошибка доступа');
echo DIV_TITLE . 'Ошибка доступа' . CLOSE_DIV;
echo DIV_ERROR . 'Ошибка!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Главная</a> / <a href="'.HOME.'/forum/">Форум</a> / <b>Ошибка доступа</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$status = ($theme['fix'] == 0 ? 1 : 0);
DB::$dbs->query("UPDATE ".FORUM_THEME." SET `fix` = ? WHERE `id` = ? ", array($status, $theme['id']));
header("Location: ".HOME."/forum/".$theme['forum_id']."/".$theme['forumc_id']."/".$theme['id']."/");
?>