<?php
// $Id: newtopic.php,v 1.2 2004/07/19 20:34:53 Farsus Exp $
// -------------------------------------------------------------------------//
//			       RUNCMS
//
//	 Relaible - Unique - Nocost &  Simplicity & ease off use
//                       < http://www.runcms.org >
// -------------------------------------------------------------------------//
// Original Author: Kazumi Ono
// Author Website : http://www.mywebaddons.com/ , http://www.myweb.ne.jp
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //

include_once("header.php");

if ( empty($forum) ) {
	redirect_header("index.php", 2, _MD_ERRORFORUM);
	exit();
} else {
	$sql = "SELECT * FROM ".$bbTable['forums']." WHERE forum_id = $forum";
	if(!$result = $db->query($sql)) {
		redirect_header("index.php", 2, _MD_CANTGETFORUM);
		exit();
	}
	$forumdata = $db->fetch_array($result);
	
	$permissions = get_forum_auth($forumdata['forum_id']);
	if ( $permissions['can_view'] == 0 || $permissions['can_post'] == 0)
	{
		redirect_header("viewforum.php?order=$order&viewmode=$viewmode&forum=$forum",2,_MD_NORIGHTTOPOST);
		exit();
	}

	include_once(XOOPS_ROOT_PATH."/header.php");
	OpenTable();
	$istopic  = 1;
	$pid      = 0;
	$subject  = "";
	$message  = "";
	$viewmode = $myts->oopsHtmlSpecialChars($viewmode);
	$hidden   = "";
	unset($post_id);
	unset($topic_id);
	include_once("include/forumform.inc.php");
	CloseTable();
	include_once(XOOPS_ROOT_PATH."/footer.php");
}
?>
