\n" . '' . "\n\n"; } function wpsr_retweet_twitter_script(){ // Return the script return "\n\n" . '' . "\n\n"; } function wpsr_retweet_bt_used(){ ## Get template data $wpsr_template1 = get_option('wpsr_template1_data'); $wpsr_template2 = get_option('wpsr_template2_data'); $wpsr_template1_content = $wpsr_template1['content']; $wpsr_template2_content = $wpsr_template2['content']; $is_retweetbt_used = strpos($wpsr_template1_content . $wpsr_template2_content, '{retweet-bt}'); if ($is_retweetbt_used === false) { return 0; } else { return 1; } } function wpsr_retweet($args = ''){ global $post; $details = wpsr_get_post_details(); $def_url = $details['permalink']; $def_title = $details['title']; $defaults = array ( 'output' => 'button', 'url' => $def_url, 'title' => $def_title, 'username' => '', 'service' => 'twitter', 'type' => 'compact', 'topsytheme' => 'blue', 'twitter_recacc' => '', 'twitter_lang' => 'en', 'text' => __('Retweet this' ,'wpsr'), 'image' => WPSR_PUBLIC_URL . 'buttons/retweet-bt.png', 'params' => '', ); $args = wp_parse_args($args, $defaults); extract($args, EXTR_SKIP); $pid = $post->ID; $purl = home_url() . '/?p=' . $pid; ## Start Output $retweet_processed = "\n\n"; switch($output){ // Display the buttons case 'button': switch($service){ // Twitter button processing code case 'twitter': switch($type){ case 'normal': $type = 'vertical'; break; case 'compact': $type = 'horizontal'; break; case 'nocount': $type = 'none'; break; } $user = ($username == '') ? '' : "data-via='$username'"; $recacc = ($twitter_recacc == '') ? '' : "data-related='$twitter_recacc'"; $retweet_processed .= ''; break; // Tweetmeme processing code case "tweetmeme" : $retweet_processed .= '' . "\n" . ''; break; // Topsy processing code case "topsy" : if($type == 'normal'){ $type = "big"; }else{ $type = ''; } $retweet_processed .= '
'; break; // Retweet processing code case "retweet" : if($type == 'normal'){ $type = ""; }else{ $type = "size = 'small'; "; } $retweet_processed .= '' . ''; break; } break; // Display the image format case 'image': $retweet_processed .= '