Changeset 398385
- Timestamp:
- 06/17/2011 02:48:43 PM (15 years ago)
- Location:
- wp-tweet-button/trunk
- Files:
-
- 3 edited
-
inc/settings.inc.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
wp-tweet-button.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-tweet-button/trunk/inc/settings.inc.php
r382285 r398385 471 471 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_bwdata_attr') == '1') echo 'checked="checked"'; ?> name="tw_bwdata_attr" id="tw_bwdata_attr" /> 472 472 <label for="tw_bwdata_attr"><?php _e('Build Tweet Button with HTML5 data attributes.',$this->txtdom); ?></label><br /> 473 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_urlencode') == '1') echo 'checked="checked"'; ?> name="tw_urlencode" id="tw_urlencode" /> 474 <label for="tw_urlencode"><?php _e('Check this box if you experience character encoding issues.',$this->txtdom); ?></label><br /> 473 475 <input type="checkbox" value="1" <?php if ($this->tw_get_option('tw_url_samecount') == '1') echo 'checked="checked"'; ?> name="tw_url_samecount" id="tw_url_samecount" /> 474 476 <label for="tw_url_samecount"><?php _e('Display the same tweet count across all shorteners.',$this->txtdom); ?></label><br /> -
wp-tweet-button/trunk/readme.txt
r382285 r398385 130 130 == Changelog == 131 131 132 = 2.1.1 = 133 * Added option for blogs experiencing character encoding issues. 134 132 135 = 2.1.0 = 133 136 * Added option to exclude button blow posts in the archives (No After in Archives) … … 135 138 * Added support for %POSTCONTENT% variable in tweet customizations 136 139 * Added "Long Tweet Mode" (In case you don't want to use %POSTCONTENT% as your "Custom text"). This allows you to auto-tweet the first part of your content followed by a link that takes the reader to the entry on your site. 137 * Links are included in all Autotweets by default. Option s to decideaction has been removed.140 * Links are included in all Autotweets by default. Option to select action has been removed. 138 141 139 142 = 2.0.9 = -
wp-tweet-button/trunk/wp-tweet-button.php
r382285 r398385 2 2 /* 3 3 Plugin Name: WP Tweet Button 4 Version: 2.1. 04 Version: 2.1.1 5 5 Plugin URI: http://0xtc.com/plugins/wp-tweet-button 6 6 Description: The WordPress implementation of the official Twitter Tweet Button. … … 119 119 'tw_auto_long_tweet_mode'=>'', 120 120 'tw_script_infooter'=>'0', 121 'tw_urlencode'=>'0', 121 122 'tw_prev_content_dup'=>'1' 122 123 ); … … 154 155 'tw_no_https_shortlinks', 155 156 'tw_prev_content_dup', 157 'tw_urlencode', 156 158 'tw_nostyle_feed' 157 159 ); … … 335 337 $activepost = $post; 336 338 } 339 337 340 return $activepost; 338 341 } … … 474 477 * This function decides the format of the tweet text based on preferences and limitations. 475 478 */ 476 function tw_get_text($entitydecode=false,$dots=true){ 479 function tw_get_text($entitydecode=false,$dots=true){ 477 480 $activepost = $this->tw_get_activepost(); 478 481 if (get_post_meta($activepost->ID, '_twitterrelated_custom_text', true)){ … … 484 487 } else { 485 488 $tw_text = $this->tw_get_option('tw_text'); 486 if ($tw_text=='entry_title') { $button_data_text = get_the_title($activepost->ID);} 487 if ($tw_text=='page_title') { $button_data_text = get_the_title($activepost->ID) .' - '. get_bloginfo('name');} 489 490 if ($this->tw_get_option('tw_urlencode')=='1'){ 491 if ($tw_text=='entry_title') { $button_data_text =$activepost->post_title;} 492 if ($tw_text=='page_title') { $button_data_text = $activepost->post_title .' - '. get_bloginfo('name');} 493 } else { 494 if ($tw_text=='entry_title') { $button_data_text = get_the_title($activepost->ID);} 495 if ($tw_text=='page_title') { $button_data_text = get_the_title($activepost->ID) .' - '. get_bloginfo('name');} 496 } 488 497 if ($tw_text=='blog_title') { $button_data_text = get_bloginfo('name');} 489 498 if ($tw_text=='custom_title') { $button_data_text = $this->tw_preptext(stripslashes($this->tw_get_option('tw_text_custom')));} … … 527 536 $tmptxt = null; 528 537 $tmptxt= str_replace('%POSTCONTENT%', strip_tags($activepost->post_content), $text); 529 $tmptxt= str_replace('%POSTTITLE%', get_the_title($activepost->ID), $tmptxt); 538 if ($this->tw_get_option('tw_urlencode')=='1'){ 539 $tmptxt= str_replace('%POSTTITLE%', $activepost->post_title, $tmptxt); 540 } else { 541 $tmptxt= str_replace('%POSTTITLE%', get_the_title($activepost->ID), $tmptxt); 542 } 530 543 $tmptxt= str_replace('%BLOGTITLE%', get_bloginfo('name'), $tmptxt); 531 544 $tmptxt= str_replace('%BLOGHASHTAGS%', $this->tw_get_hash_tags(), $tmptxt); … … 587 600 } 588 601 589 add_action('profile_update', array(&$this, 'tw_account_cleanup')); 602 add_action('profile_update', array(&$this, 'tw_account_cleanup')); 603 604 605 590 606 } 591 607 … … 878 894 // $button_data_status_id = 'data-status-id="'.$tid.'"'; 879 895 } 880 $button_data_text = 'data-text="'.$textprefix . htmlspecialchars($this->tw_get_text(null)).'"'; 896 $thetext = htmlspecialchars($textprefix . $this->tw_get_text(null)); 897 $button_data_text = 'data-text="'.$thetext.'"'; 881 898 $button_data_related = 'data-related="'.$this->tw_get_related_text().'"'; 882 899 $button_data_count = 'data-count="'.$this->tw_get_option('tw_count').'"'; … … 912 929 } 913 930 } 914 $button .= '&text='.str_replace('+','%20',urlencode($textprefix . $this->tw_get_text(true))); 931 $thetext = urlencode($textprefix . $this->tw_get_text(true)); 932 $button .= '&text='.str_replace(array('+',' '),'%20',$thetext); 915 933 $button .= '&related='.$this->tw_get_related_text(true); 916 934 $button .= '&lang='.$this->tw_get_option('tw_lang'); … … 1543 1561 /** 1544 1562 * Class, exciting and new. Create one or even a few. Bugs, a coder's reward. Ruins flow and it comes back to you. Wordpress, soon will be making another run and Wordpress promises something for everyone.... 1545 */ 1563 */ 1564 1546 1565 $wpTweetButton = new wpTweetButton(); 1547 1566 load_plugin_textdomain($wpTweetButton->txtdom,null,dirname( plugin_basename( __FILE__ ) ).'/lang/');
Note: See TracChangeset
for help on using the changeset viewer.