<?php
// ======================================================================== //
//   KOOBI - CMS                                                            //
//   SCRiPTMAFiA 2005 - THE DiRTY HANDS ON YOUR SCRiPTS                     //
//                                                                          //
//   DREAM4 - AM MICHELSGRUND 7 - 69469 WEINHEIM - GERMANY                  //    
//   TEL. +49(0) 6201 - 980442 / FAX. +49(0) 6201 - 64809                   //
// ======================================================================== //
$f_id = escs($_REQUEST['fid']);
$permissions = getForumPermissionsByUser($f_id, UID);

if ( ($islogged == 0 ) || ($permissions[FORUM_PERMISSIONS_CAN_OPEN_TOPIC] == 0) ) {
	$EOUT = msg("nopermission", "nopermission_t", str_replace("__URL__", "index.php?p=showforums&amp;area=$area", $lang['redirect']), "index.php?p=showforums&amp;area=$area");
	$NOOUT = 1;
}

if($NOOUT != 1){
	
	if ($_GET['toid'] == "") {
		$EOUT = msg("f_newforum", "f_noid", str_replace("__URL__", "index.php?p=showforums&amp;area=$area", $lang['redirect']), "index.php?p=showforums&amp;area=$area");
		$NOOUT = 1;
	}
	
	$status = FORUM_STATUS_OPEN;
	$r_opentopic = new dbc("UPDATE " . PREFIX . "_f_topic SET status = $status WHERE id = '" . escs($_GET['toid']) . "'");
	
	$EOUT = msg("f_forum", "f_actionsuccess", str_replace("__URL__", "index.php?p=showtopic&amp;toid=$_GET[toid]&amp;area=$area", $lang['redirect']), "index.php?p=showtopic&amp;toid=$_GET[toid]&amp;area=$area");
	$NOOUT = 1;
}
?>