Файл: public_html/modules/forum/act.php
Строк: 32
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.net *
* ------------------------------- *
* @package: PerfCMS Ultra *
* @year: 2013 *
* @author: wanya26ua & Tesla *
* @link: http://perfclub.ru *
**********************************/
if(isset($user) && isset($_GET['topic_id']) && $db->query("SELECT * FROM `forum_t` WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'")->rowCount() == 1) {
if(($user['level']>=3 || $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') {
$db->query("UPDATE `forum_t` SET `closed` = '1' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
$db->query("INSERT INTO `forum_pt` SET `text` = 'Тема закрыта :)', `time` = '". time() ."', `user_id` = '0', `topic_id` = '".abs(intval($_GET['topic_id']))."', `file` = '', `file_size` = '0', `edit_time` = '0', `edit_user_id` = '0', `count_edit` = '0', `cat_id` = '0', `name` = ''");
go('/forum/topic'.abs(intval($_GET['topic_id'])).'/?page=end');
}elseif(($user['level']>=3 || $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') {
$db->query("UPDATE `forum_t` SET `closed` = '0' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
$db->query("INSERT INTO `forum_pt` SET `text` = 'Тема открыта :)', `time` = '". time() ."', `user_id` = '0', `topic_id` = '".abs(intval($_GET['topic_id']))."', `file` = '', `file_size` = '0', `edit_time` = '0', `edit_user_id` = '0', `count_edit` = '0', `cat_id` = '0', `name` = ''");
go('/forum/topic'.abs(intval($_GET['topic_id'])).'/?page=end');
}if($user['level']>=6 && $_GET['act'] == 'attach') {
$db->query("UPDATE `forum_t` SET `attach` = '1' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
go('/forum/topic'.abs(intval($_GET['topic_id'])).'/?page=end');
}if($user['level']>=6 && $_GET['act'] == 'unpin') {
$db->query("UPDATE `forum_t` SET `attach` = '0' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
go('/forum/topic'.abs(intval($_GET['topic_id'])).'/?page=end');
}
} else { go('/forum/'); }
?>