Example #1
0
function wpsr_retweet_shortcode($atts)
{
    $wpsr_retweet = get_option('wpsr_retweet_data');
    if ($atts['service'] == 'twitter' || $atts['service'] == '') {
        $script = $atts['script'] == "0" ? '' : wpsr_retweet_twitter_script();
    } elseif ($atts['service'] == 'topsy') {
        $script = $atts['script'] == "0" ? '' : wpsr_retweet_topsy_script();
    } elseif ($atts['service'] == 'tweetmeme' || $atts['service'] == 'retweet') {
        $script = '';
    }
    $atts['username'] = $wpsr_retweet['username'];
    // Included @username for retweet buttons v2.4.6
    return wpsr_retweet($atts) . $script;
}
Example #2
0
/**
 * One function for displaying the buttons in theme files
 * Use wp_socializer(the button code or template name) in the theme files to print the 
 * button or the template
 * 
 * Available button codes are given in the variable $wpsr_button_code_list (line 582) without brackets
 * Available template name are 'template1' and 'template2'
 */
function wp_socializer($to_display, $params = "")
{
    switch ($to_display) {
        case 'socialbts':
            return wpsr_socialbts($params);
            break;
        case 'addthis':
            return wpsr_addthis($params);
            break;
        case 'sharethis':
            return wpsr_sharethis($params);
            break;
        case 'retweet':
            return wpsr_retweet($params);
            break;
        case 'digg':
            return wpsr_digg($params);
            break;
        case 'facebook':
            return wpsr_facebook($params);
            break;
        case 'plusone':
            return wpsr_plusone($params);
            break;
        case 'stumbleupon':
            return wpsr_stumbleupon($params);
            break;
        case 'reddit':
            return wpsr_reddit($params);
            break;
        case 'linkedin':
            return wpsr_linkedin($params);
            break;
        case 'pinterest':
            return wpsr_pinterest($params);
            break;
        case 'custom-1':
            return wpsr_custom_bt('custom1');
            break;
        case 'custom-2':
            return wpsr_custom_bt('custom2');
            break;
        case 'template-1':
            return wpsr_process_template('1');
            break;
        case 'template-2':
            return wpsr_process_template('2');
            break;
    }
}
Example #3
0
function wpsr_retweet_rss_bt()
{
    ## Start Output
    $wpsr_retweet_processed = wpsr_retweet(array('output' => 'text', 'params' => 'target="_blank"'));
    ## End Output
    return $wpsr_retweet_processed;
}