Файл: modules/forum/delete_topic.php
Строк: 44
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$locate = 'in_forum';
if(User::level() == 2 || User::level() >= 5)
{
if(isset($_GET['id']))
{
$d = $db->query("SELECT cat_id FROM `forum_t` WHERE `id` = '".abs(intval($_GET['id']))."'")->fetchColumn();
if(isset($_POST['yes']))
{
$db->query("DELETE FROM `forum_pt` WHERE `topic_id` = '". abs(intval($_GET['id'])) ."'");
$db->query("DELETE FROM `forum_t` WHERE `id` = '". abs(intval($_GET['id'])) ."'");
redirect('/forum/section/'.$d);
}
elseif(isset($_POST['no']))
{
redirect('/forum/topic/'.abs(intval($_GET['id'])));
}
$title = _t('delete');
include_header($title);
$tpl->div('title', _t('delete'));
echo '<form action="/forum/delete_topic/'.abs(intval($_GET['id'])).'/" method="post">
<div class="menu">
<b>'. _t('r_sure') .'</b><br/>
<input name="yes" type="submit" value="'. _t('yyes') .'" /> <input name="no" type="submit" value="'. _t('yno') .'" /><br/>
</div>
</form>';
$tpl->div('block', NAV .'<a href="/forum/">'. _t('forum') .'</a><br/>' . HICO .'<a href="/">'. _t('home').'</a>');
include_footer();
} else { redirect('/'); }
} else { redirect('/'); }
?>