function bb_check_comment_flood($ip = '', $email = '', $date = '')
{
    bb_log_deprecated('function', __FUNCTION__, 'bb_check_post_flood');
    bb_check_post_flood();
}
Example #2
0
<?php

require './bb-load.php';
if (bb_is_login_required()) {
    bb_auth('logged_in');
}
bb_check_post_flood();
if (!($post_content = trim($_POST['post_content']))) {
    bb_die(__('You need to actually submit some content!'));
}
$post_author = $post_email = $post_url = '';
if (!bb_is_user_logged_in()) {
    if (bb_is_login_required()) {
        bb_die(__('You are not allowed to post.  Are you logged in?'));
    } else {
        if (!($post_author = sanitize_user(trim($_POST['author'])))) {
            bb_die(__('You need to submit your name!'));
        } elseif (!($post_email = sanitize_email(trim($_POST['email'])))) {
            bb_die(__('You need to submit a valid email address!'));
        }
        if (!empty($_POST['url'])) {
            $post_url = esc_url(trim($_POST['url']));
        }
    }
}
if (isset($_POST['topic']) && ($forum_id = (int) $_POST['forum_id'])) {
    if (bb_is_login_required() && !bb_current_user_can('write_posts')) {
        bb_die(__('You are not allowed to post.  Are you logged in?'));
    }
    if (bb_is_login_required() && !bb_current_user_can('write_topic', $forum_id)) {
        bb_die(__('You are not allowed to write new topics.'));