<?
require_once '../../../core/system.php';
echo only_reg();
echo admin();
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_topic` WHERE `id` = '".intval($_GET['id'])."'"),0) == true){
$topic = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_topic` WHERE `id`  = '".intval($_GET['id'])."'"));
}else{
$_SESSION['err'] = "Топик не найден!";
header('Location: /forum/');
exit();
}
header("Location: /forum/post/topic/$topic[id]/");
mysql_query("UPDATE `forum_topic` SET `close` = '1' WHERE `id` = '$topic[id]' LIMIT 1");
$_SESSION['message'] = "Топик Закрыт!";
exit();
?>