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

Размер файла: 1.56Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. if(isset($user) && isset($_GET['topic_id']) && $db->query("SELECT * FROM `forum_t` WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'")->rowCount() == 1) {
  9. if(($user['level']>=5 || $user['id'] == $db->query("SELECT user_id FROM `forum_pt` WHERE `topic_id` = '". abs(intval($_GET['topic_id']))."' ORDER BY time ASC LIMIT 1")->fetchColumn()) && $_GET['act'] == 'close') {
  10. $db->query("UPDATE `forum_t` SET `closed` = '1' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
  11. go('/forum/topic'.abs(intval($_GET['topic_id'])).'/?page=end');
  12. }elseif(($user['level']>=5 || $user['id'] == $db->query("SELECT user_id FROM `forum_pt` WHERE `topic_id` = '". abs(intval($_GET['topic_id']))."' ORDER BY time ASC LIMIT 1")->fetchColumn()) && $_GET['act'] == 'open') {
  13. $db->query("UPDATE `forum_t` SET `closed` = '0' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
  14. go('/forum/topic'.abs(intval($_GET['topic_id'])).'/?page=end');
  15. }if($user['level']>=6 && $_GET['act'] == 'attach') {
  16. $db->query("UPDATE `forum_t` SET `attach` = '1' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
  17. go('/forum/topic'.abs(intval($_GET['topic_id'])).'/?page=end');
  18. }if($user['level']>=6 && $_GET['act'] == 'unpin') {
  19. $db->query("UPDATE `forum_t` SET `attach` = '0' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
  20. go('/forum/topic'.abs(intval($_GET['topic_id'])).'/?page=end');
  21. }
  22. } else { go('/forum/'); }
  23. ?>