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

Размер файла: 1.56Kb
<?php
/**********************************
*	@package: PerfCMS			  *
*	@year: 2012					  *
*	@author: Artas				  *
*	@link: http://perfcms.pp.ua	  *
**********************************/
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']>=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') {
$db->query("UPDATE `forum_t` SET `closed` = '1' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
go('/forum/topic'.abs(intval($_GET['topic_id'])).'/?page=end');
}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') {
$db->query("UPDATE `forum_t` SET `closed` = '0' WHERE `id` = '". abs(intval($_GET['topic_id'])) ."'");
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/'); }
?>