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