Exemple #1
0
function socialit_insert_in_post($post_content)
{
    global $socialit_plugopts, $bbdb;
    // decide whether or not to generate the bookmarks.
    $istopic = bb_is_topic();
    if ($istopic && $socialit_plugopts['topic'] == 1 || bb_is_feed() && $socialit_plugopts['feed'] == 1 && bb_get_topicmeta(get_topic_id(), 'hide_socialit') != "true") {
        //socials should be generated and added
        $post_id_fc = get_post_id();
        //post id for check
        if (bb_is_first($post_id_fc)) {
            $post_content .= get_socialit();
        }
    }
    return $post_content;
}
Exemple #2
0
        bb_die(__('Every post needs an author name!'));
    } elseif (!($post_email = sanitize_email(trim($_POST['email'])))) {
        bb_die(__('Every post needs a valid email address!'));
    }
    if (!empty($_POST['url'])) {
        $post_url = esc_url(trim($_POST['url']));
    }
}
// Loop through possible anonymous post data
foreach (array('post_author', 'post_email', 'post_url') as $field) {
    if (!empty(${$field})) {
        $post_data[$field] = ${$field};
    }
}
// Setup topic data
if (bb_is_first($bb_post->post_id) && bb_current_user_can('edit_topic', $bb_post->topic_id)) {
    $post_data['topic_title'] = stripslashes($_POST['topic']);
    $post_data['topic_id'] = $bb_post->topic_id;
    bb_insert_topic($post_data);
}
// Setup post data
$post_data['post_text'] = stripslashes($_POST['post_content']);
$post_data['post_id'] = $post_id;
bb_insert_post($post_data);
if ($post_id) {
    if ($_REQUEST['view'] === 'all') {
        add_filter('get_post_link', 'bb_make_link_view_all');
    }
    $post_link = get_post_link($post_id);
    nxt_redirect($post_link);
} else {