$CORE->load_CoreModule('forums.base'); $CORE->loggedInOrReturn(); //setup new instance of multiple errors $ERRORS->NewInstance('post_topic'); //Define the variables $forumId = isset($_POST['forum']) ? (int) $_POST['forum'] : false; $title = isset($_POST['title']) ? $_POST['title'] : false; $text = isset($_POST['text']) ? $_POST['text'] : false; $staffPost = isset($_POST['staff_post']) ? true : false; ###################################### ############### CHECKS ############### if (!$forumId) { //We have no forum id $ERRORS->Add('An unexpected error occurred, missing forum id.'); } else { if (!WCF::verifyForumId($forumId)) { //Veirfy the forum $ERRORS->Add('An unexpected error occurred, the selected forum is invalid.'); } } if (!$title) { $ERRORS->Add('Please enter topic title.'); } else { if (strlen($title) > 150) { $ERRORS->Add('The topic title is too long, maximum 150 characters.'); } } if (!$text) { $ERRORS->Add('Please enter text for the topic.'); } //Check for errors