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']))."'");
}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']))."'");