Файл: modules/forum/delete.php
Строк: 24
<?php
define('R', $_SERVER['DOCUMENT_ROOT']);
define('S', R.'/system');
require_once(R.'/system/kernel.php');
$tmp->header('forum');
$tmp->title('title', Language::config('delet'));
User::panel();
$id = $db->guard($_GET['id']);
$p=$db->fass("select * from `forum_topic` where `id` = '".$id."' ");
if(!$p){
$tmp->div('error', Language::config('error'));
$tmp->div('menu', '<a href="/">'.img('link.png').' '.Language::config('home').'</a>');
$tmp->footer();
exit();
}
if(!User::aut()){
header('location: /');
}
if(User::aut()){
$del = $db->guard($_GET['delete']);
$c=$db->fass("SELECT * FROM `forum_message` where `id` ='".$del."'");
if(!$c){
$tmp->div('error', Language::config('error'));
$tmp->div('menu', '<a href="/">'.img('link.png').' '.Language::config('home').'</a>');
$tmp->footer();
exit();
}
if(User::profile('level') >=3) {
$db->query("DELETE FROM `forum_message` where `id` ='".$del."'");
$db->query("DELETE FROM `forum_file` where `post_id` ='".$del."'");
}
header('location: /forum/topic'.$id);
}
$tmp->footer();
?>