Файл: forum/delete.php
Строк: 19
<?php
define('R', $_SERVER['DOCUMENT_ROOT']);
define('S', R.'/system');
require_once(R.'/system/kernel.php');
$id = $db->guard($_GET['id']);
$tmp->header('forum');
$p=$db->fass("select * from `forum_topic` where `id` = '".$id."' ");
$s=$db->fass("select * from `forum_section` where `id` = '".$p['section']."'");
$r=$db->fass("select * from `forum_razdel` where `id` = '".$p['razdel']."'");
$tmp->div('title', Language::config('forum').' / '. $r['name'].' / '.$s['name']. ' / '.$p['name']);
User::panel();
$del = $db->guard($_GET['delete']);
$c=$db->fass("SELECT * FROM `forum_message` where `id` ='".$del."'");
if(!$c){
$tmp->div('block', Language::config('error'));
$tmp->div('menu', '<a href="/forum/topic'.$id.'">'.Language::config('back').'</a>');
$tmp->footer();
exit();
}
if($c['kto'] == User::ID() || User::profile('level') >=3)
$db->query("DELETE FROM `forum_message` where `id` ='".$del."'");
header('location: /forum/topic'.$id);
$tmp->footer();
?>