Plugin Directory

Changeset 398385


Ignore:
Timestamp:
06/17/2011 02:48:43 PM (15 years ago)
Author:
0xTC
Message:
 
Location:
wp-tweet-button/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-tweet-button/trunk/inc/settings.inc.php

    r382285 r398385  
    471471                            <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" />
    472472                            <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 />
    473475                            <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" />
    474476                            <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  
    130130== Changelog ==
    131131
     132= 2.1.1 =
     133* Added option for blogs experiencing character encoding issues.
     134
    132135= 2.1.0 =
    133136* Added option to exclude button blow posts in the archives (No After in Archives)
     
    135138* Added support for %POSTCONTENT% variable in tweet customizations
    136139* 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. Options to decide action has been removed.
     140* Links are included in all Autotweets by default. Option to select action has been removed.
    138141
    139142= 2.0.9 =
  • wp-tweet-button/trunk/wp-tweet-button.php

    r382285 r398385  
    22/*
    33Plugin Name: WP Tweet Button
    4 Version: 2.1.0
     4Version: 2.1.1
    55Plugin URI: http://0xtc.com/plugins/wp-tweet-button
    66Description: The WordPress implementation of the official Twitter Tweet Button.
     
    119119        'tw_auto_long_tweet_mode'=>'',
    120120        'tw_script_infooter'=>'0',
     121        'tw_urlencode'=>'0',
    121122        'tw_prev_content_dup'=>'1'
    122123        );
     
    154155        'tw_no_https_shortlinks',
    155156        'tw_prev_content_dup',
     157        'tw_urlencode',
    156158        'tw_nostyle_feed'
    157159        );
     
    335337            $activepost = $post;
    336338        }
     339
    337340        return $activepost;
    338341    }
     
    474477    * This function decides the format of the tweet text based on preferences and limitations.
    475478    */
    476     function tw_get_text($entitydecode=false,$dots=true){
     479    function tw_get_text($entitydecode=false,$dots=true){   
    477480        $activepost = $this->tw_get_activepost();
    478481        if (get_post_meta($activepost->ID, '_twitterrelated_custom_text', true)){
     
    484487        } else {
    485488            $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            }
    488497            if ($tw_text=='blog_title')  { $button_data_text = get_bloginfo('name');}
    489498            if ($tw_text=='custom_title') { $button_data_text = $this->tw_preptext(stripslashes($this->tw_get_option('tw_text_custom')));}
     
    527536        $tmptxt = null;
    528537        $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        }
    530543        $tmptxt= str_replace('%BLOGTITLE%', get_bloginfo('name'), $tmptxt);
    531544        $tmptxt= str_replace('%BLOGHASHTAGS%', $this->tw_get_hash_tags(), $tmptxt);
     
    587600            }
    588601
    589             add_action('profile_update',        array(&$this, 'tw_account_cleanup'));   
     602            add_action('profile_update',        array(&$this, 'tw_account_cleanup'));
     603           
     604
     605           
    590606    }
    591607   
     
    878894//          $button_data_status_id = 'data-status-id="'.$tid.'"';
    879895        }
    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.'"';
    881898        $button_data_related = 'data-related="'.$this->tw_get_related_text().'"';
    882899        $button_data_count = 'data-count="'.$this->tw_get_option('tw_count').'"';
     
    912929            }
    913930        }
    914         $button .= '&amp;text='.str_replace('+','%20',urlencode($textprefix . $this->tw_get_text(true)));
     931        $thetext = urlencode($textprefix . $this->tw_get_text(true));
     932        $button .= '&amp;text='.str_replace(array('+',' '),'%20',$thetext);
    915933        $button .= '&amp;related='.$this->tw_get_related_text(true);
    916934        $button .= '&amp;lang='.$this->tw_get_option('tw_lang');
     
    15431561/**
    15441562* 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
    15461565$wpTweetButton = new wpTweetButton();
    15471566load_plugin_textdomain($wpTweetButton->txtdom,null,dirname( plugin_basename( __FILE__ ) ).'/lang/');
Note: See TracChangeset for help on using the changeset viewer.