Location: PHPKode > projects > Content*Builder > modules/forum/messageAddThread.inc.php
<?php

/*
* messageAdd.inc.php
*
* @version $Id: messageAddThread.inc.php,v 1.1 2004/05/07 09:14:12 cb_fog Exp $
* @copyright 2003 
*/

$errorType = array();

/*
* Um einen Thread zu starten muss $forumID korrekt sein
* des weiteren muss die Kategorie freigegeben sein
*/

$categoryQuery = $nestedSet_category->getNode($_REQUEST[forumID], true);
if(($categoryQuery == false)) {
	/* Forum wurde nicht gefunden */
	if($forum_option->getSingleOption("allow_top_level_posting") != 1) {
		$errorType[] = 1;
	}
} else {
	if(!(FORUM_CATEGORY_WRITEABLE & $categoryQuery[options])) {
		/* Forum ist nicht freigegeben zum schreiben */
		$errorType[] = 2;
	}
}


if(count($errorType) == 0) {
	if(empty($messagePostSubmit)) {
		$tpl->assign("ACTION", $action);
		require_once($actualModuleDir."messagePost.inc.php");
	} else {
		if(!empty($_SESSION[community_uid])) {
			$messageAdditionalArr = array (
				"title"      => $messagePostSubject,
				"message"    => $messagePostText
			);
		
			$_REQUEST[messageID] = $forumObj->addMessage($messageAdditionalArr);
			$threadAddResult = $forumObj->addThread($_REQUEST[messageID], $_REQUEST[forumID]);
			if($threadAddResult == 0) {
				$nestedSet_message->deleteNode($_REQUEST[messageID]);
				unset($_REQUEST[messageID]);
			}
		}
			
		if(!empty($_REQUEST[messageID])) {
			require_once($actualModuleDir."showThread.inc.php");
		}
	}
}

?>
Return current item: Content*Builder