WordPress.org

Plugin Directory

Changeset 353641


Ignore:
Timestamp:
03/01/11 08:06:42 (3 years ago)
Author:
kirilln
Message:

Patch version 3.3.3

Location:
tweet-blender/trunk
Files:
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • tweet-blender/trunk/admin-page.php

    r350819 r353641  
    11<?php 
    22 
    3 // Version 3.3.2 
    4  
     3// Version 3.3.3 
     4 
     5// include TweetBlender library 
     6include_once(dirname(__FILE__).'/lib/lib.php'); 
     7 
     8// set up data structure for addon tracking 
    59$tb_installed_addons = array(); 
    610$tb_active_addons = array(); 
     
    7478function tb_admin_page() { 
    7579 
    76     global $tb_option_names, $tb_option_names_system, $tb_keep_tweets_options, $tb_languages, $cache_clear_results, $tb_throttle_time_options, $tb_installed_addons, $tb_active_addons, $tb_package_names; 
    77  
     80    global $wp_json, $tb_option_names, $tb_option_names_system, $tb_keep_tweets_options, $tb_languages, $cache_clear_results, $tb_throttle_time_options, $tb_installed_addons, $tb_active_addons, $tb_package_names; 
     81 
     82    // if we don't have json class, get the compatibility library 
     83    if ( !is_a($wp_json, 'Services_JSON') ) { 
     84        require_once( ABSPATH . WPINC . '/class-json.php' ); 
     85        $wp_json = new Services_JSON(); 
     86    } 
     87         
    7888    $upgrade_message = ''; 
    7989 
     
    135145    $api_limit_data = null; 
    136146    if ($json_data = tb_get_server_rate_limit_json($tb_o)) { 
    137         $json = new Services_JSON(); 
    138         $api_limit_data = $json->decode($json_data); 
     147        $api_limit_data = $wp_json->decode($json_data); 
    139148    } 
    140149 
     
    753762        <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
    754763        <input type="hidden" name="cmd" value="_xclick" /> 
    755         <input type="hidden" name="business" value="tweetblender@gmail.com"> 
    756         <input type="hidden" name="lc" value="US"> 
    757         <input type="hidden" name="currency_code" value="USD"> 
    758         <input type="hidden" name="no_note" value="1"> 
     764        <input type="hidden" name="business" value="tweetblender@gmail.com" /> 
     765        <input type="hidden" name="lc" value="US" /> 
     766        <input type="hidden" name="currency_code" value="USD" /> 
     767        <input type="hidden" name="no_note" value="1" /> 
    759768        <input type="hidden" name="amount" value="2.99" /> 
    760769        <input type="hidden" name="item_name" value="Cache Manager for Tweet Blender" /> 
     
    764773        <input type="hidden" name="notify_url" value="http://tweetblender.com/ipn.php" /> 
    765774        <input type="hidden" name="image_url" value="http://tweetblender.com/tweet-blender-logo_150x50.png" /> 
    766         <input type="hidden" name="return" value="<?php echo tb_get_current_page_url(); ?>&install_addon=1" /> 
     775        <input type="hidden" name="return" value="<?php echo tb_get_current_page_url(); ?>&amp;install_addon=1" /> 
    767776        <input type="hidden" name="cbt" value="Return to your site to complete installation" /> 
    768777        <input type="hidden" name="cancel_return" value="<?php echo tb_get_current_page_url(); ?>#tab-7" /> 
    769778        <input type="submit" name="submit" class="button-secondary" value="Get Cache Manager" /> 
    770         <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
     779        <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" /> 
    771780    </form> 
    772781     
     
    774783    </div> 
    775784    <div class="box-right centered"> 
    776         <a href="/<?php echo(PLUGINDIR); ?>/tweet-blender/screenshot-10.png" title="Cache Manager for Tweet Blender"><img class="tb-addon-screenshot" src="/<?php echo(PLUGINDIR); ?>/tweet-blender/img/cache_manager_th.jpg" /></a> 
    777     </div> 
    778  
     785        <a href="<?php echo plugins_url('tweet-blender/screenshot-10.png'); ?>" title="Cache Manager for Tweet Blender"><img class="tb-addon-screenshot" src="<?php echo plugins_url('tweet-blender/img/cache_manager_th.jpg'); ?>" /></a> 
     786    </div> 
     787    <br clear="all" /> 
    779788    <?php  
    780789        // if Cache Manager is not active 
  • tweet-blender/trunk/js/main.js

    r350819 r353641  
    33 */ 
    44 
    5 var TB_version = '3.3.2',   // Plugin version  
     5var TB_version = '3.3.3',   // Plugin version  
    66TB_rateLimitData, 
    77TB_tmp, 
     
    6868        TB_config.widgets[widgetId] = new Object; 
    6969         
    70         // set all properties (backward compatibiliy) 
     70        // set all properties (backward compatibility) 
    7171        jQuery.each(jQuery('#'+widgetConfId).children('input'),function(j,property) { 
    7272            TB_config.widgets[widgetId][property.name] = property.value; 
  • tweet-blender/trunk/lib/lib.php

    r350819 r353641  
    11<?php 
    22 
    3 // Version 3.3.2 
     3// Version 3.3.3 
    44 
    55// aliases for sources 
     
    405405 
    406406function tb_get_cached_tweets_json($sources) { 
    407     global $json; 
     407    global $wp_json; 
    408408     
    409409    $tweets = array(); 
    410410    $tweets = tb_get_cached_tweets($sources, 500); 
    411411    foreach ($tweets as $t){ 
    412         $tweet = $json->decode($t->tweet_json); 
     412        $tweet = $wp_json->decode($t->tweet_json); 
    413413        $tweet['div_id'] = $t->div_id; 
    414414        $tweets[] = $tweet; 
    415415    } 
    416416     
    417     return $json->encode($tweets); 
     417    return $wp_json->encode($tweets); 
    418418} 
    419419 
    420420function tb_save_cache($tweets) { 
    421     global $wpdb, $json; 
     421    global $wpdb, $wp_json; 
    422422 
    423423    if (is_array($tweets) || (is_object($tweets) && !version_compare(PHP_VERSION, '5.0.0', '<'))) { 
     
    452452                        $wpdb->escape($src) . "','" .  
    453453                        $wpdb->escape($t->text) . "','" . 
    454                         $wpdb->escape($json->encode($t)) . "')" 
     454                        $wpdb->escape($wp_json->encode($t)) . "')" 
    455455                    ); 
    456456                     
     
    470470function tb_get_cached_tweets_html($mode,$instance,$widget_id = '') { 
    471471 
    472     global $json; 
     472    global $wp_json; 
     473 
     474    // if we don't have json class, get the library 
     475    if ( !is_a($wp_json, 'Services_JSON') ) { 
     476        require_once( ABSPATH . WPINC . '/class-json.php' ); 
     477        $wp_json = new Services_JSON(); 
     478    } 
    473479     
    474480    // get options 
     
    492498    $tweets = tb_get_cached_tweets($sources, $tweets_to_show,$widget_id); 
    493499    foreach ($tweets as $t){ 
    494         $tweet = $json->decode($t->tweet_json); 
     500        $tweet = $wp_json->decode($t->tweet_json); 
    495501        $tweet->{'div_id'} = $t->div_id; 
    496502        $tweets_html .= tb_tweet_html($tweet,$mode,$tb_o); 
  • tweet-blender/trunk/readme.txt

    r350819 r353641  
    33Tags: sidebar, twitter, tweets, multiple authors, favorites, tweet, tags, lists, hashtags, archive, widget, admin, AJAX, jquery, keywords, BuddyPress 
    44Requires at least: 2.8.0 
    5 Tested up to: 3.0.5 
    6 Stable tag: 3.3.2 
     5Tested up to: 3.1 
     6Stable tag: 3.3.3 
    77Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5907095 
    88 
     
    177177== Changelog == 
    178178 
     179= 3.3.3 = 
     180* Bug fix: visual editor and other AJAX features broken in WP3.1 on PHP4 when plugin is active due to JSON library conflict (thanks to Nezi, Gabor R, Geoffrey F, and @ILoveStyle_be for reporting) 
     181* Bug fix: Cache panel layout broken if blog is not at root url and Cache Manager addon is not installed 
     182 
    179183= 3.3.2 = 
    180184* Bug fix: blending private/pass-protected accounts did not find any tweets 
  • tweet-blender/trunk/tweet-blender.php

    r350819 r353641  
    44Plugin URI: http://www.tweet-blender.com 
    55Description: Provides several Twitter widgets: show your own tweets, show tweets relevant to post's tags, show tweets for Twitter lists, show tweets for hashtags, show tweets for keyword searches, show favorite tweets. Multiple widgets on the same page are supported. Can combine sources and blend all of them into a single stream. 
    6 Version: 3.3.2 
     6Version: 3.3.3 
    77Author: Kirill Novitchenko 
    88Author URI: http://kirill-novitchenko.com 
     
    2525    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    2626*/ 
    27  
    28 // include JSON library 
    29 class_exists('Services_JSON') || require(dirname(__FILE__).'/lib/JSON.php'); 
    30 $json = new Services_JSON(); 
    3127 
    3228// if on PHP5, include oAuth library and config 
  • tweet-blender/trunk/widget-favorites.php

    r348497 r353641  
    11<?php 
    22 
    3 // version 3.3.0 
     3// version 3.3.3 
    44 
    55class TweetBlenderFavorites extends WP_Widget { 
     
    1313    function widget($args, $instance) { 
    1414 
    15         global $post,$json; 
     15        global $post; 
    1616        if (sizeof($args) > 0) { 
    1717            extract($args, EXTR_SKIP);           
     
    281281    function check_source($src,$tb_o) { 
    282282 
    283         global $json; 
     283        global $wp_json; 
    284284        $need_oauth = false; 
    285285        $is_private = false; 
     
    288288        $is_ok = false; 
    289289 
     290        // if we don't have json class, get the library 
     291        if ( !is_a($wp_json, 'Services_JSON') ) { 
     292            require_once( ABSPATH . WPINC . '/class-json.php' ); 
     293            $wp_json = new Services_JSON(); 
     294        } 
     295         
    290296        // remove private account markup 
    291297        if (stripos($src,'!') === 0) { 
     
    327333        // try to get data from Twitter 
    328334        if (!is_wp_error($result)) { 
    329             $jsonData = $json->decode($result['body']); 
     335            $jsonData = $wp_json->decode($result['body']); 
    330336            // if Twitter reported error 
    331337            if (!isset($jsonData)) { 
  • tweet-blender/trunk/widget-tags.php

    r348497 r353641  
    11<?php 
    22 
    3 // v3.3.0 
     3// v3.3.3 
    44 
    55class TweetBlenderForTags extends WP_Widget { 
     
    1313    function widget($args, $instance) { 
    1414 
    15         global $post, $json; 
     15        global $post; 
    1616                 
    1717        // don't show widget if we are not on a post page 
  • tweet-blender/trunk/widget.php

    r350819 r353641  
    11<?php 
    22 
    3 // version 3.3.2 
     3// version 3.3.3 
    44 
    55class TweetBlender extends WP_Widget { 
     
    1313    function widget($args, $instance) { 
    1414 
    15         global $post,$json; 
     15        global $post,$wp_json; 
    1616        if (sizeof($args) > 0) { 
    1717            extract($args, EXTR_SKIP);           
     
    298298    function check_source($src,$tb_o) { 
    299299 
    300         global $json; 
     300        global $wp_json; 
    301301        $need_oauth = false; 
    302302        $is_private = false; 
     
    305305        $is_ok = false; 
    306306 
     307        // if we don't have json class, get the library 
     308        if ( !is_a($wp_json, 'Services_JSON') ) { 
     309            require_once( ABSPATH . WPINC . '/class-json.php' ); 
     310            $wp_json = new Services_JSON(); 
     311        } 
     312         
    307313        // remove private account markup 
    308314        if (stripos($src,'!') === 0) { 
     
    340346        // try to get data from Twitter 
    341347        if (!is_wp_error($result)) { 
    342             $jsonData = $json->decode($result['body']); 
     348            $jsonData = $wp_json->decode($result['body']); 
    343349            if (!isset($jsonData)) { 
    344350                $source_check_result = ' ' . $src . ' - <span class="fail">FAIL</span>'; 
  • tweet-blender/trunk/ws.php

    r350819 r353641  
    11<?php 
    22 
    3 // version 3.3.0 
     3// version 3.3.3 
    44 
    55// include WP functions 
    66require_once("../../../wp-blog-header.php"); 
    7  
    8 // include JSON library 
    9 class_exists('Services_JSON') || require(dirname(__FILE__).'/lib/JSON.php'); 
    10 $json = new Services_JSON(); 
    117 
    128// if on PHP5, include oAuth library and config 
     
    2521// get options from WP 
    2622$tb_o = get_option('tweet-blender'); 
     23 
     24// if we don't have json class, get the library 
     25if (!isset($wp_json) || !is_a($wp_json, 'Services_JSON') ) { 
     26    require_once( ABSPATH . WPINC . '/class-json.php' ); 
     27    $wp_json = new Services_JSON(); 
     28} 
     29 
    2730 
    2831// if request is for favorites, search results, user timeline, or list timeline 
     
    5659    } 
    5760    elseif($_GET['action'] == 'favorites') { 
    58         $sources = array('@'.$_GET['user']); 
    59         $url = 'https://api.twitter.com/1/favorites/' . $_GET['user'] . '.json'; 
     61        $sources = array('@'.$_GET['screen_name']); 
     62        $url = 'https://api.twitter.com/1/favorites/' . $_GET['screen_name'] . '.json'; 
    6063        unset($params['user']); 
    6164    } 
     
    6770 
    6871    // check if it's a private source or if we are rerouting with oAuth 
    69     if ($_GET['private'] || ($tb_o['advanced_reroute_on'] && $tb_o['advanced_reroute_type'] == 'oauth')) { 
     72    if (isset($_GET['private']) || ($tb_o['advanced_reroute_on'] && $tb_o['advanced_reroute_type'] == 'oauth')) { 
    7073         
    7174        // check to make sure we have the class 
    7275        if (!class_exists('TwitterOAuth')) { 
    73             echo $json->encode(array('error' => 'Twitter oAuth is not available')); 
     76            echo $wp_json->encode(array('error' => 'Twitter oAuth is not available')); 
    7477            exit; 
    7578        } 
     
    7780        // make sure we have oAuth info 
    7881        if (!isset($tb_o['oauth_access_token'])){ 
    79             echo $json->encode(array('error' => "Don't have oAuth login info")); 
     82            echo $wp_json->encode(array('error' => "Don't have oAuth login info")); 
    8083            exit; 
    8184        } 
     
    133136        // if it was an error 
    134137        else { 
    135             echo $json->encode(array('error' => $result->get_error_message()));  
     138            echo $wp_json->encode(array('error' => $result->get_error_message()));   
    136139        } 
    137140    } 
     
    146149    } 
    147150    else { 
    148         echo $json->encode(array('error' => "Can't retrieve limit info from Twitter")); 
     151        echo $wp_json->encode(array('error' => "Can't retrieve limit info from Twitter")); 
    149152        exit; 
    150153    } 
     
    158161        $referer = parse_url(esc_attr($_SERVER['HTTP_REFERER'])); 
    159162        if ($referer['host'] != esc_attr($_SERVER['SERVER_NAME']) && $referer['host'] != 'www.' . esc_attr($_SERVER['SERVER_NAME'])) { 
    160             echo $json->encode(array('error' => "Request from unauthorized page. \n" . esc_attr($_SERVER['SERVER_NAME']) . "\n" . $referer['host'])); 
     163            echo $wp_json->encode(array('error' => "Request from unauthorized page. \n" . esc_attr($_SERVER['SERVER_NAME']) . "\n" . $referer['host'])); 
    161164            exit; 
    162165        } 
     
    167170    // make sure data is really JSON 
    168171    $data = stripslashes($_POST['tweets']); 
    169     if($tweets = $json->decode($data)) { 
     172    if($tweets = $wp_json->decode($data)) { 
    170173 
    171174        if(tb_save_cache($tweets)) { 
    172175            // return OK 
    173             echo $json->encode(array('OK' => 1)); 
     176            echo $wp_json->encode(array('OK' => 1)); 
    174177        } 
    175178        else { 
    176             echo $json->encode(array('error' => 'Cannot store tweets to DB')); 
     179            echo $wp_json->encode(array('error' => 'Cannot store tweets to DB')); 
    177180        } 
    178181        exit; 
    179182    } 
    180183    else { 
    181         echo $json->encode(array('error' => 'Invalid data format')); 
     184        echo $wp_json->encode(array('error' => 'Invalid data format')); 
    182185        exit; 
    183186    }        
Note: See TracChangeset for help on using the changeset viewer.