Ejemplo n.º 1
0
$CORE->load_CoreModule('forums.base');
$CORE->loggedInOrReturn();
//setup new instance of multiple errors
$ERRORS->NewInstance('post_reply');
//Define the variables
$topicId = isset($_POST['topic']) ? (int) $_POST['topic'] : false;
$title = isset($_POST['title']) ? $_POST['title'] : false;
$text = isset($_POST['text']) ? $_POST['text'] : false;
$staffPost = isset($_POST['staff_post']) ? true : false;
######################################
############### CHECKS ###############
if (!$topicId) {
    //We have no forum id
    $ERRORS->Add('An unexpected error occurred, missing topic id.');
} else {
    if (!WCF::verifyTopicId($topicId)) {
        //Veirfy the forum
        $ERRORS->Add('An unexpected error occurred, the selected topic is invalid.');
    }
}
if ($title && strlen($title) > 150) {
    $ERRORS->Add('The reply title is too long, maximum 150 characters.');
}
if (!$text) {
    $ERRORS->Add('Please enter text for the reply.');
}
//Check for errors
$ERRORS->Check('/forums.php?page=post_reply');
##################################################
######## REGISTER SERVER ACCOUNT #################
//Resolve the forum name and id