Esempio n. 1
0
/**
 * Add reply link below each post
 *
 * @param $post_links Array of the links
 * @param $args Array of args
 */
function em_reply_link($post_links = array(), $args = array())
{
    global $em_plugopts;
    if ($em_plugopts['reply-link'] == 1 && $em_plugopts['reply-text'] && bb_is_topic() && topic_is_open() && (bb_is_user_logged_in() || function_exists('bb_is_login_required') && !bb_is_login_required())) {
        /* Check if link is needed */
        $text = str_replace("%%POSTLINK%%", get_post_link(), str_replace("%%USERNAME%%", get_post_author(), $em_plugopts['reply-text']));
        $js = "var ema=document.getElementById('post_content');var emb=ema.value;if(emb!='')emb+='\\n\\n';ema.value=emb+'" . $text . "\\n\\n';ema.focus();void(0);";
        $post_links[] = $args['before_each'] . '<a class="reply_link" style="cursor:pointer" onclick="' . $js . '">' . __('Reply', 'easy-mentions') . '</a>' . $args['after_each'];
    }
    return $post_links;
}
Esempio n. 2
0
    $socialit_plugopts['shortyapi'] = array('snip' => array('user' => '', 'key' => ''), 'bitly' => array('user' => '', 'key' => ''), 'supr' => array('chk' => 0, 'user' => '', 'key' => ''), 'trim' => array('chk' => 0, 'user' => '', 'pass' => ''), 'tinyarrow' => array('chk' => 0, 'user' => ''), 'cligs' => array('chk' => 0, 'key' => ''));
    bb_update_option(SOCIALIT_OPTIONS, $socialit_plugopts);
    //update with edited options
}
if ($socialit_plugopts['shorty'] == 'e7t') {
    $socialit_plugopts['shorty'] = 'b2l';
    //now, no more e7t, instead b2l.me
    bb_update_option(SOCIALIT_OPTIONS, $socialit_plugopts);
    //update with edited options
}
//fix for Social It 1.3, will be removed after the release of 1.5
if (!is_array($socialit_plugopts['bookmark'])) {
    $socialit_plugopts['bookmark'] = array_keys($socialit_bookmarks_data);
    bb_update_option(SOCIALIT_OPTIONS, $socialit_plugopts);
    //update with edited options
}
//add actions/filters
add_action('bb_admin_menu_generator', 'socialit_menu_link', -998);
//link in settings
add_action('bb_admin_head', 'socialit_admin', 997);
//admin css
add_action('bb_head', 'socialit_public', 997);
//public css
if (bb_is_topic() && $_GET['socialit_hide_show'] == "1") {
    add_action('bb_init', 'socialit_hide_show_do', 997);
    //do the function of hide/show socialit
}
add_filter('post_text', 'socialit_insert_in_post', 997);
//to insert social it automatically below the first post of every topic
add_filter('bb_topic_admin', 'socialit_hide_show', 6);
//to show the option to the admin whether to show the bookmark menu on a particular topic
Esempio n. 3
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;
}
Esempio n. 4
0
<?php

if (!bb_is_topic()) {
    ?>
<input name="topic" type="text" id="topic" maxlength="80" tabindex="1" />
<?php 
}
?>

<?php 
do_action('post_form_pre_post');
?>
<textarea name="post_content" id="post_content" tabindex="1"></textarea>
<input type="submit" id="postformsub" name="Submit" value="<?php 
echo esc_attr__('Send Post &raquo;');
?>
" tabindex="2" />
function is_topic()
{
    bb_log_deprecated('function', __FUNCTION__, 'bb_is_topic');
    return bb_is_topic();
}
function bb_template_scripts()
{
    if (bb_is_topic() && bb_is_user_logged_in()) {
        wp_enqueue_script('topic');
    } elseif (bb_is_profile() && bb_is_user_logged_in()) {
        global $self;
        if ($self == 'profile-edit.php') {
            wp_enqueue_script('profile-edit');
        }
    }
}
Esempio n. 7
0
function bb_bozo_post_permalink()
{
    if (bb_is_topic()) {
        remove_filter('get_topic_where', 'bb_bozo_topics');
    }
}