Просмотр файла modules/forum/delete_topic.php

Размер файла: 1.22Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $locate = 'in_forum';
  9. if($user['level'] == 2 || $user['level'] >= 5) {
  10. if(isset($_GET['topic_id'])) {
  11. if(isset($_POST['yes'])) {
  12. $db->query("DELETE FROM `forum_pt` WHERE `topic_id` = '". abs(intval($_GET['topic_id'])) ."'");
  13. $db->query("DELETE FROM `forum_t` WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
  14. go('/forum/');
  15. } elseif(isset($_POST['no'])) {
  16. go('/forum/');
  17. }
  18. $title = $lang->word('delete');
  19. require_once(SYS.'/view/header.php');
  20. $tpl->div('title', $lang->word('delete'));
  21. echo '<form action="/forum/delete_topic/'.abs(intval($_GET['topic_id'])).'/" method="post">
  22. <div class="menu">
  23. <b>'. $lang->word('r_sure') .'</b><br/>
  24. <input name="yes" type="submit" value="'. $lang->word('yyes') .'" /> <input name="no" type="submit" value="'. $lang->word('yno') .'" /><br/>
  25. </div>
  26. </form>';
  27. $tpl->div('block', NAV .'<a href="/forum/">'. $lang->word('forum') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
  28. require_once(SYS.'/view/footer.php');
  29. } else { go('/'); }
  30. } else { go('/'); }
  31. ?>