WordPress.org

Plugin Directory

Changeset 381114


Ignore:
Timestamp:
05/05/11 05:45:01 (3 years ago)
Author:
kirilln
Message:

Commiting v3.3.6

Location:
tweet-blender/trunk
Files:
4 added
6 deleted
10 edited

Legend:

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

    r357092 r381114  
    11<?php 
    22 
    3 // Version 3.3.5 
     3// Version 3.3.6 
    44 
    55// include TweetBlender library 
     
    3636function tb_admin_load_scripts() { 
    3737 
     38    global $js_labels; 
     39     
    3840    wp_enqueue_script('jquery'); 
    3941    wp_enqueue_script('jquery-ui-core'); 
    4042    wp_enqueue_script('jquery-ui-tabs'); 
    4143    wp_enqueue_script('jquery-lightbox', '/' . PLUGINDIR . '/tweet-blender/js/jquery.lightbox-0.5.min.js',array('jquery')); 
    42     wp_enqueue_script('tb-admin', '/' . PLUGINDIR . '/tweet-blender/js/admin.js',array('jquery','jquery-ui-core','jquery-ui-tabs','jquery-lightbox')); 
     44    wp_enqueue_script('tb-lib', '/' . PLUGINDIR . '/tweet-blender/js/lib.js',array('jquery')); 
     45    wp_localize_script('tb-lib', 'TB_labels', $js_labels); 
     46    wp_enqueue_script('tb-admin', '/' . PLUGINDIR . '/tweet-blender/js/admin.js',array('jquery','jquery-ui-core','jquery-ui-tabs','jquery-lightbox','tb-lib')); 
     47     
    4348} 
    4449 
     
    5863 
    5964    // add hooks for Tweet Blender admin 
    60     $pagehook = add_options_page('Tweet Blender Settings', 'Tweet Blender', 'manage_options', __FILE__, 'tb_admin_page'); 
     65    $pagehook = add_options_page(__('Tweet Blender Settings'), __('Tweet Blender', 'tweetblender'), 'manage_options', __FILE__, 'tb_admin_page'); 
    6166    add_action( 'admin_print_scripts-' . $pagehook, 'tb_admin_load_scripts' ); 
    6267    add_action( 'admin_print_styles-' . $pagehook, 'tb_admin_load_styles' ); 
     
    104109        } 
    105110        else { 
    106             echo 'Error: addon ID was not specified'; 
     111            echo __('Error','tweetblender') . ': ' . __('addon ID was not specified', 'tweetblender'); 
    107112        } 
    108113 
     
    125130            if ($txn_id = tb_get_txn_id($item_number)) { 
    126131 
    127                 $response = wp_remote_get('http://tweetblender.com/check_upgrade.php?item_number=' . $item_number . '&blog_url=' . urlencode(get_bloginfo('url')) . '&txn_id=' . $txn_id); 
     132                $version_check_url = 'http://tweetblender.com/check_upgrade.php?item_number=' . $item_number . '&blog_url=' . urlencode(get_bloginfo('url')) . '&txn_id=' . $txn_id; 
     133                $version_download_url = 'http://tweetblender.com/download.php?item_number=' . $item_number . '&blog_url=' . urlencode(get_bloginfo('url')) . '&txn_id=' . $txn_id; 
     134                $response = wp_remote_get($version_check_url); 
    128135                 
    129136                if(!is_wp_error($response)) { 
    130137                    if (isset($response['headers']['have-newer-version']) && $response['headers']['have-newer-version'] == 1) { 
    131                         $upgrade_message .= 'Newer version of ' . $name . ' is available - <a href="' . tb_get_current_page_url() . '&install_addon=1&item_number=' . $item_number . '">upgrade</a>. '; 
     138                        $upgrade_message .= sprintf(__('Newer version of %s is available','tweetblender') . ' - <a href="%s&install_addon=1&item_number=%d">' . __('upgrade automatically','tweetblender') . '</a> ' . __('or','tweetblender') . '<a href="%s"> ' . __('download to install manually','tweetblender') . '</a>', $name, tb_get_current_page_url(), $item_number, $version_download_url); 
    132139                    } 
    133140                } 
     
    176183            } 
    177184            if (sizeof($cleared_sources) > 0 ) { 
    178                 $cache_clear_results = 'Cleared cached tweets for ' . implode(', ',$cleared_sources); 
     185                $cache_clear_results = __('Cleared cached tweets for', 'tweetblender') . ' ' . implode(', ',$cleared_sources); 
    179186            } 
    180187        } 
     
    196203                    update_option('tweet-blender',$tb_o); 
    197204                     
    198                     $errors[] = "To take advantage of a whitelisted account with oAuth please <a href='javascript:tAuth(\"" . $connection->getAuthorizeURL($token) . "\")' title='Authorize Twitter Access'>use your Twitter account to authorize access</a>."; 
     205                    $errors[] = __('To take advantage of a whitelisted account with oAuth ' , 'tweetblender') . "<a href='javascript:tAuth(\"" . $connection->getAuthorizeURL($token) . "\")' title=__('Authorize Twitter Access', 'tweetb)>__('please use your Twitter account to authorize access','tweetblender')</a>."; 
    199206                } 
    200207                else { 
    201                     $errors[] = "Not able to form oAuth authorization request URL. HTTP status code: " . $connection->http_code; 
     208                    $errors[] =  __("Not able to form oAuth authorization request URL. HTTP status code: ", 'tweetblender') . $connection->http_code; 
    202209                }                    
    203210            } 
     
    219226                unset($tb_o['archive_is_disabled']); 
    220227            } 
    221  
     228             
    222229            // cycle through all possible options 
    223230            foreach($tb_option_names as $opt) { 
     
    231238                } 
    232239            } 
     240 
     241            // process filter keywords and remove empty elements 
     242            if (isset($tb_o['filter_bad_strings'])) { 
     243                $filtered_words = explode(',', $tb_o['filter_bad_strings']); 
     244                 
     245                $clean = array(); 
     246                foreach ($filtered_words as $badw) { 
     247                    $badw = trim($badw); 
     248                    if (strlen($badw) > 0) { 
     249                        $clean[] = $badw; 
     250                    } 
     251                } 
     252                 
     253                $tb_o['filter_bad_strings'] = implode(',',$clean); 
     254            } 
    233255             
    234256            update_option('tweet-blender',$tb_o); 
    235257            // Put an options updated message on the screen 
    236             $message = '<div class="updated"><p><strong>Settings saved. ' . $cache_clear_results . '</strong></p></div>'; 
     258            $message = '<div class="updated"><p><strong>' . __('Settings saved', 'tweetblender')  . '. ' . $cache_clear_results . '</strong></p></div>'; 
    237259        }    
    238260 
     
    241263    // if addon installation was cancelled by user, show message 
    242264    if (isset($_GET['install_addon']) && $_GET['install_addon'] == 0) { 
    243         $message = '<div class="updated"><p><strong>Addon installation was cancelled.</strong> If you have any questions, please use one of the links under the Help tab.</p></div>'; 
     265        $message = '<div class="updated"><p><strong>'. __('Addon installation was cancelled','tweetblender') . '</strong> ' . __('If you have any questions, please use one of the links under the Help tab', 'tweetblender') . '.</p></div>'; 
    244266    } 
    245267 
     
    248270<script type="text/javascript"> 
    249271    var lastUsedTabId = <?php if (isset($_POST['tb_tab_index'])) { echo $_POST['tb_tab_index']; } else { echo 0; } ?>, 
    250     TB_pluginPath = '<?php echo plugins_url('tweet-blender') ?>', 
     272    TB_pluginPath = '<?php echo plugins_url("tweet-blender") ?>', 
    251273    TB_CM_pluginPath = '<?php echo plugins_url('tweet-blender-cache-manager'); ?>', 
    252274    TB_cacheManagerAvailable = <?php if ($tb_installed_addons[1] && $tb_active_addons[1]) { echo 'true'; } else { echo 'false'; } ?>; 
     
    254276 
    255277<div class="wrap"> 
    256     <div id="icon-tweetblender" class="icon32"><br/></div><h2><?php _e('Tweet Blender', 'mt_trans_domain' ); ?></h2> 
     278    <div id="icon-tweetblender" class="icon32"><br/></div><h2><?php _e('Tweet Blender', 'tweetblender' ); ?></h2> 
    257279 
    258280    <?php  
     
    263285    <div id="tabs"> 
    264286    <ul> 
    265         <li><a href="#tab-1"><span>General</span></a></li> 
    266         <li><a href="#tab-2"><span>Widgets</span></a></li> 
    267         <li><a href="#tab-3"><span>Archive</span></a></li> 
    268         <li><a href="#tab-4"><span>Filters</span></a></li> 
    269         <li><a href="#tab-5"><span>Advanced</span></a></li> 
    270         <li id="statustab"><a href="#tab-6"><span>Status</span></a></li> 
    271         <li id="cache-manager-tab"><a href="#tab-7"><span>Cache</span></a></li> 
    272         <li><a href="#tab-8"><span>Help</span></a></li> 
     287        <li><a href="#tab-1"><span><?php _e('General', 'tweetblender'); ?></span></a></li> 
     288        <li><a href="#tab-2"><span><?php _e('Widgets', 'tweetblender'); ?></span></a></li> 
     289        <li><a href="#tab-3"><span><?php _e('Archive', 'tweetblender'); ?></span></a></li> 
     290        <li><a href="#tab-4"><span><?php _e('Filters', 'tweetblender'); ?></span></a></li> 
     291        <li><a href="#tab-5"><span><?php _e('Advanced', 'tweetblender'); ?></span></a></li> 
     292        <li id="statustab"><a href="#tab-6"><span><?php _e('Status', 'tweetblender'); ?></span></a></li> 
     293        <li id="cache-manager-tab"><a href="#tab-7"><span><?php _e('Cache', 'tweetblender'); ?></span></a></li> 
     294        <li><a href="#tab-8"><span><?php _e('Help', 'tweetblender'); ?></span></a></li> 
    273295    </ul> 
    274296 
     
    288310            <label for="general_link_urls"> 
    289311            <input type="checkbox" name="general_link_urls" <?php checked('on', $tb_o['general_link_urls']); ?>/> 
    290             <?php _e("Link http &amp; https URLs insde tweet text", 'mt_trans_domain' ); ?> 
     312            <?php _e("Link http &amp; https URLs insde tweet text", 'tweetblender' ); ?> 
    291313            </label> 
    292314            </th> 
     
    296318            <label for="general_link_screen_names"> 
    297319            <input type="checkbox" name="general_link_screen_names" <?php checked('on', $tb_o['general_link_screen_names']); ?>/> 
    298             <?php _e('Link @screenname inside tweet text', 'mt_trans_domain' ); ?> 
     320            <?php _e('Link @screenname inside tweet text', 'tweetblender' ); ?> 
    299321            </label> 
    300322            </th> 
     
    304326            <label for="general_link_hash_tags"> 
    305327            <input type="checkbox" name="general_link_hash_tags" <?php checked('on', $tb_o['general_link_hash_tags']); ?>/> 
    306             <?php _e("Link #hashtags insde tweet text", 'mt_trans_domain' ); ?> 
    307             </label> 
    308             </th> 
    309         </tr> 
    310         <tr valign="top"> 
    311             <th class="th-full" colspan="2" scope="row"> 
    312             <h3>SEO</h3> 
     328            <?php _e("Link #hashtags insde tweet text", 'tweetblender' ); ?> 
     329            </label> 
     330            </th> 
     331        </tr> 
     332        <tr valign="top"> 
     333            <th class="th-full" colspan="2" scope="row"> 
     334            <h3><?php _e('SEO', 'tweetblender'); ?></h3> 
    313335            <label for="general_seo_tweets_googleoff"> 
    314336            <input type="checkbox" name="general_seo_tweets_googleoff" <?php checked('on', $tb_o['general_seo_tweets_googleoff']); ?>/> 
    315             <?php _e('Wrap all tweets with googleoff/googleon tags to prevent indexing', 'mt_trans_domain' ); ?> 
     337            <?php _e('Wrap all tweets with googleoff/googleon tags to prevent indexing', 'tweetblender' ); ?> 
    316338            </label> 
    317339            </th> 
     
    321343            <label for="general_seo_footer_googleoff"> 
    322344            <input type="checkbox" name="general_seo_footer_googleoff" <?php checked('on', $tb_o['general_seo_footer_googleoff']); ?>/> 
    323             <?php _e('Wrap footer with date and time in all tweets with googleoff/googleon tags to prevent indexing', 'mt_trans_domain' ); ?> 
     345            <?php _e('Wrap footer with date and time in all tweets with googleoff/googleon tags to prevent indexing', 'tweetblender' ); ?> 
    324346            </label> 
    325347            </th> 
     
    335357            <label for="widget_check_sources"> 
    336358            <input type="checkbox" name="widget_check_sources" <?php checked('on', $tb_o['widget_check_sources']); ?>/> 
    337             <?php _e("Check and verify sources when widget settings are saved", 'mt_trans_domain' ); ?> 
     359            <?php _e("Check and verify sources when widget settings are saved", 'tweetblender' ); ?> 
    338360            </label> 
    339361            </th> 
     
    343365            <label for="widget_show_header"> 
    344366            <input type="checkbox" name="widget_show_header" <?php checked('on', $tb_o['widget_show_header']); ?>/> 
    345             <?php _e("Show header with Twitter logo and refresh link for each widget", 'mt_trans_domain' ); ?> 
     367            <?php _e("Show header with Twitter logo and refresh link for each widget", 'tweetblender' ); ?> 
    346368            </label> 
    347369            </th> 
     
    351373            <label for="widget_show_photos"> 
    352374            <input type="checkbox" name="widget_show_photos" <?php checked('on', $tb_o['widget_show_photos']); ?>/> 
    353             <?php _e("Show user's photo for each tweet", 'mt_trans_domain' ); ?> 
     375            <?php _e("Show the photo from the author for each tweet", 'tweetblender' ); ?> 
    354376            </label> 
    355377            </th> 
     
    359381            <label for="widget_show_user"> 
    360382            <input type="checkbox" name="widget_show_user" <?php checked('on', $tb_o['widget_show_user']); ?>/> 
    361             <?php _e("Show author's username for each tweet", 'mt_trans_domain' ); ?> 
     383            <?php _e("Show username from the author for each tweet", 'tweetblender' ); ?> 
    362384            </label> 
    363385            </th> 
     
    367389            <label for="widget_show_source"> 
    368390            <input type="checkbox" name="widget_show_source" <?php checked('on', $tb_o['widget_show_source']); ?>/> 
    369             <?php _e("Show tweet source for each tweet", 'mt_trans_domain' ); ?> 
     391            <?php _e("Show tweet source for each tweet", 'tweetblender' ); ?> 
    370392            </label> 
    371393            </th> 
     
    375397            <label for="widget_show_reply_link"> 
    376398            <input type="checkbox" name="widget_show_reply_link" <?php checked('on', $tb_o['widget_show_reply_link']); ?>/> 
    377             <?php _e("Show reply link for each tweet (on mouse over)", 'mt_trans_domain' ); ?> 
     399            <?php _e("Show reply link for each tweet (on mouse over)", 'tweetblender' ); ?> 
    378400            </label> 
    379401            </th> 
     
    383405            <label for="widget_show_follow_link"> 
    384406            <input type="checkbox" name="widget_show_follow_link" <?php checked('on', $tb_o['widget_show_follow_link']); ?>/> 
    385             <?php _e("Show follow link for each tweet (on mouse over)", 'mt_trans_domain' ); ?> 
     407            <?php _e("Show follow link for each tweet (on mouse over)", 'tweetblender' ); ?> 
    386408            </label> 
    387409            </th> 
     
    397419            <label for="archive_is_disabled"> 
    398420            <input type="checkbox" id="archive_is_disabled" name="archive_is_disabled" <?php checked('on', $tb_o['archive_is_disabled']); ?>/> 
    399             <?php _e('Disable archive page', 'mt_trans_domain' ); ?>  
     421            <?php _e('Disable archive page', 'tweetblender' ); ?>  
    400422            </label> 
    401423            </th> 
     
    405427            <label for="archive_auto_page"> 
    406428            <input type="checkbox" id="archive_auto_page" name="archive_auto_page" <?php checked('on', $tb_o['archive_auto_page']); ?>/> 
    407             <?php _e('Create archive page automatically', 'mt_trans_domain' ); ?>  
     429            <?php _e('Create archive page automatically', 'tweetblender' ); ?>  
    408430            </label> 
    409431            </th> 
    410432        </tr> 
    411433        <tr valign="top" <?php if (isset($tb_o['archive_is_disabled']) && $tb_o['archive_is_disabled']) echo 'style="display:none;"'; ?>> 
    412             <th scope="row"><label for="archive_tweets_num"><?php _e('Maximum number of tweets to show', 'mt_trans_domain' ); ?>: 
     434            <th scope="row"><label for="archive_tweets_num"><?php _e('Maximum number of tweets to show', 'tweetblender' ); ?>: 
    413435            </label></th> 
    414436            <td> 
     
    432454        </tr> 
    433455        <tr valign="top" <?php if (isset($tb_o['archive_is_disabled']) && $tb_o['archive_is_disabled']) echo 'style="display:none;"'; ?>> 
    434             <th scope="row"><label for="archive_keep_tweets"><?php _e('Automatically remove tweets that are older than', 'mt_trans_domain' ); ?>: 
     456            <th scope="row"><label for="archive_keep_tweets"><?php _e('Automatically remove tweets that are older than', 'tweetblender' ); ?>: 
    435457            </label></th> 
    436458            <td> 
     
    450472            <label for="archive_show_photos"> 
    451473            <input type="checkbox" name="archive_show_photos" <?php checked('on', $tb_o['archive_show_photos']); ?>/> 
    452             <?php _e("Show user's photo for each tweet", 'mt_trans_domain' ); ?> 
     474            <?php _e("Show the photo from the author for each tweet", 'tweetblender' ); ?> 
    453475            </label> 
    454476            </th> 
     
    458480            <label for="archive_show_user"> 
    459481            <input type="checkbox" name="archive_show_user" <?php checked('on', $tb_o['archive_show_user']); ?>/> 
    460             <?php _e("Show author's username for each tweet", 'mt_trans_domain' ); ?> 
     482            <?php _e("Show username from the author for each tweet", 'tweetblender' ); ?> 
    461483            </label> 
    462484            </th> 
     
    466488            <label for="archive_show_source"> 
    467489            <input type="checkbox" name="archive_show_source" <?php checked('on', $tb_o['archive_show_source']); ?>/> 
    468             <?php _e("Show tweet source", 'mt_trans_domain' ); ?> 
     490            <?php _e("Show tweet source for each tweet", 'tweetblender' ); ?> 
    469491            </label> 
    470492            </th> 
     
    474496            <label for="archive_show_reply_link"> 
    475497            <input type="checkbox" name="archive_show_reply_link" <?php checked('on', $tb_o['archive_show_reply_link']); ?>/> 
    476             <?php _e("Show reply link for each tweet (on mouse over)", 'mt_trans_domain' ); ?> 
     498            <?php _e("Show reply link for each tweet (on mouse over)", 'tweetblender' ); ?> 
    477499            </label> 
    478500            </th> 
     
    482504            <label for="archive_show_follow_link"> 
    483505            <input type="checkbox" name="archive_show_follow_link" <?php checked('on', $tb_o['archive_show_follow_link']); ?>/> 
    484             <?php _e("Show follow link for each tweet (on mouse over)", 'mt_trans_domain' ); ?> 
     506            <?php _e("Show follow link for each tweet (on mouse over)", 'tweetblender' ); ?> 
    485507            </label> 
    486508            </th> 
     
    493515        <table class="form-table"> 
    494516        <tr valign="top"> 
    495             <th scope="row"><label for="filter_limit_per_source"><?php _e('Throttling', 'mt_trans_domain' ); ?>:</label></th> 
     517            <th scope="row"><label for="filter_limit_per_source"><?php _e('Throttling', 'tweetblender' ); ?>:</label></th> 
    496518            <td> 
    497             <?php _e('For each user show a maximum of ', 'mt_trans_domain' ); ?> <select name="filter_limit_per_source"> 
    498                 <option value="">All</option> 
    499                 <?php 
     519            <?php  
     520                $throttle_select1 = '<select name="filter_limit_per_source"><option value="">' . __('All', 'tweetblender') . '</option>'; 
    500521                foreach (range(1,10) as $lim) { 
    501                     echo '<option value="' . $lim . '"'; 
     522                    $throttle_select1 .= '<option value="' . $lim . '"'; 
    502523                    if ($lim == $tb_o['filter_limit_per_source']) { 
    503                         echo ' selected'; 
    504                     } 
    505                     echo '>' . $lim . '</option>'; 
    506                 } 
    507             ?></select> tweet(s) within <select name="filter_limit_per_source_time"> 
    508                 <?php 
     524                        $throttle_select1 .= ' selected'; 
     525                    } 
     526                    $throttle_select1 .= '>' . $lim . '</option>'; 
     527                } 
     528                $throttle_select1 .= '</select>'; 
     529                 
     530                $throttle_select2 = '<select name="filter_limit_per_source_time">'; 
    509531                foreach ($tb_throttle_time_options as $name => $sec) { 
    510                     echo '<option value="' . $sec . '"'; 
     532                    $throttle_select2 .= '<option value="' . $sec . '"'; 
    511533                    if ($sec == $tb_o['filter_limit_per_source_time']) { 
    512                         echo ' selected'; 
    513                     } 
    514                     echo '>' . $name . '</option>'; 
    515                 } 
    516             ?></select> 
     534                        $throttle_select2 .= ' selected'; 
     535                    } 
     536                    $throttle_select2 .= '>' . $name . '</option>'; 
     537                } 
     538                $throttle_select2 .= '</select>'; 
     539                 
     540                echo sprintf(__('For each user show a maximum of %s tweet(s) within %s', 'tweetblender'), $throttle_select1, $throttle_select2); 
     541            ?> 
    517542            </td> 
    518543        </tr> 
    519544        <tr valign="top"> 
    520             <th scope="row"><label for="filter_lang"><?php _e('Show only tweets in', 'mt_trans_domain' ); ?>:</label></th> 
     545            <th scope="row"><label for="filter_lang"><?php _e('Show only tweets in', 'tweetblender' ); ?>:</label></th> 
    521546            <td> 
    522547            <select name="filter_lang"> 
     
    535560            <th class="th-full" colspan="2" scope="row"> 
    536561            <input type="checkbox" name="filter_hide_same_text" <?php checked('on', $tb_o['filter_hide_same_text']); ?>/> 
    537             <label for="filter_hide_same_text"><?php _e("Hide tweets that come from different users but have exactly the same text", 'mt_trans_domain' ); ?></label> 
     562            <label for="filter_hide_same_text"><?php _e("Hide tweets that come from different users but have exactly the same text", 'tweetblender' ); ?></label> 
    538563            </th> 
    539564        </tr> 
    540565        <tr valign="top"> 
    541566            <th class="th-full" colspan="2" scope="row"> 
    542             <input type="checkbox" name="filter_hide_replies" <?php checked('on', $tb_o['filter_hide_replies']); ?>/> 
    543             <label for="filter_hide_replies"><?php _e("Hide tweets that are in reply to other tweets", 'mt_trans_domain' ); ?></label> 
     567            <input type="checkbox" id="filter_hide_replies" name="filter_hide_replies" <?php checked('on', $tb_o['filter_hide_replies']); ?>/> 
     568            <label for="filter_hide_replies"><?php _e("Hide replies", 'tweetblender' ); ?></label> 
    544569            </th> 
    545570        </tr> 
    546571        <tr valign="top"> 
    547572            <th class="th-full" colspan="2" scope="row"> 
    548             <input type="checkbox" name="filter_hide_not_replies" <?php checked('on', $tb_o['filter_hide_not_replies']); ?>/> 
    549             <label for="filter_hide_not_replies"><?php _e("Hide tweets that are NOT replies to other tweets", 'mt_trans_domain' ); ?></label> 
     573            <input type="checkbox" id="filter_hide_not_replies" name="filter_hide_not_replies" <?php checked('on', $tb_o['filter_hide_not_replies']); ?>/> 
     574            <label for="filter_hide_not_replies"><?php _e("Show only replies", 'tweetblender' ); ?></label> 
    550575            </th> 
    551576        </tr> 
     
    553578            <th class="th-full" colspan="2" scope="row"> 
    554579            <input type="checkbox" name="filter_hide_mentions" <?php checked('on', $tb_o['filter_hide_mentions']); ?>/> 
    555             <label for="filter_hide_mentions"><?php _e("Hide mentions of users, only show tweets from users themselves", 'mt_trans_domain' ); ?></label> 
     580            <label for="filter_hide_mentions"><?php _e("Hide mentions of users, only show tweets from users themselves", 'tweetblender' ); ?></label> 
    556581            </th> 
    557582        </tr> 
    558583        <!-- FUTURE: location-based selection 
    559584        <tr> 
    560             <th scope="row"><label for="filter_location_name"><?php _e('Show only tweets near this place ', 'mt_trans_domain' ); ?>:</label></th> 
     585            <th scope="row"><label for="filter_location_name"><?php _e('Show only tweets near this place ', 'tweetblender' ); ?>:</label></th> 
    561586            <td><input type="text" size="30" name="filter_location_name" value="<?php echo $tb_o['filter_location_name']; ?>"><br/> 
    562587                <label for="filter_location_dist">Within </label> 
     
    585610        --> 
    586611        <tr valign="top"> 
    587             <th scope="row"><label for="filter_bad_strings"><?php _e('Exclude tweets that contain these users, words or hashtags', 'mt_trans_domain' ); ?>: </label> 
     612            <th scope="row"><label for="filter_bad_strings"><?php _e('Exclude tweets that contain these users, words or hashtags', 'tweetblender' ); ?>: </label> 
    588613            </th> 
    589614            <td valign="top"> 
    590615            <textarea id="filter_bad_strings" name="filter_bad_strings" rows=2 cols=60><?php if (isset($tb_o['filter_bad_strings'])) { echo stripslashes($tb_o['filter_bad_strings']); } ?></textarea>  
    591616                <br/> 
    592                 <span class="setting-description">You can use single keywords, usernames, or phrases. Enclose phrases in quotes. Do not use @ for screen names. Separate with commas. Example: #spam,badword,"entire bad phrase",badUser,anotherBadUser,#badHashTag</span> 
     617                <span class="setting-description"><?php _e('You can use single keywords, usernames, or phrases. Do not use @ for screen names. Separate with commas. Example: #spam,badword,entire bad phrase,badUser,anotherBadUser,#badHashTag', 'tweetblender' ); ?></span> 
    593618            </td> 
    594619        </tr> 
     
    603628            <label for="advanced_reroute_on"> 
    604629            <input type="checkbox" name="advanced_reroute_on" <?php checked('on', $tb_o['advanced_reroute_on']); ?>/> 
    605             <?php _e('Re-route Twitter traffic through this server', 'mt_trans_domain' ); ?>  
    606             </label> (<input type="radio" value="oauth" name="advanced_reroute_type" <?php checked('oauth', $tb_o['advanced_reroute_type']); ?>/> user account based with oAuth <input type="radio" value="direct" name="advanced_reroute_type" <?php checked('direct', $tb_o['advanced_reroute_type']); ?>/> IP based)<br/> 
    607             <span class="setting-description">This option allows you to reroute all API calls to Twitter via your server. This is to be used ONLY if your server is a white-listed server that has higher connection allowance than each individual user.  Each user can make up to 150 Twitter API connections per hour. Each visitor to your site will have their own limit i.e. their own 150. Checking the box will make all visitors to the site use your server's connection limit, not their own limit. If you did not prearranged with Twitter to have that limit increased that means that it will be 150 for ALL visitors - be careful.</span> 
     630            <?php _e('Re-route Twitter traffic through this server', 'tweetblender' ); ?>  
     631            </label> (<input type="radio" value="oauth" name="advanced_reroute_type" <?php checked('oauth', $tb_o['advanced_reroute_type']); ?>/> <?php _e('user account based with oAuth', 'tweetblender' ); ?> <input type="radio" value="direct" name="advanced_reroute_type" <?php checked('direct', $tb_o['advanced_reroute_type']); ?>/> <?php _e('IP based', 'tweetblender' ); ?>)<br/> 
     632            <span class="setting-description"><?php _e('This option allows you to reroute all API calls to Twitter via your server. This is to be used ONLY if your server is a white-listed server that has higher connection allowance than each individual user.  Each user can make up to 150 Twitter API connections per hour. Each visitor to your site will have their own limit i.e. their own 150. Checking the box will make all visitors to the site use your servers connection limit, not their own limit. If you did not prearranged with Twitter to have that limit increased that means that it will be 150 for ALL visitors - be careful.', 'tweetblender' ); ?></span> 
    608633            </th> 
    609634        </tr> 
     
    612637            <label for="advanced_show_limit_msg"> 
    613638            <input type="checkbox" name="advanced_show_limit_msg" <?php checked('on', $tb_o['advanced_show_limit_msg']); ?>/> 
    614             <?php _e('Notify user when Twitter API connection limit is reached', 'mt_trans_domain' ); ?>  
     639            <?php _e('Notify user when Twitter API connection limit is reached', 'tweetblender' ); ?>  
    615640            </label><br/> 
    616641            <span class="setting-description"> 
    617                 When the API connection limit is reached and there is no cached data Tweet Blender can't show new tweets. If you check this box the plugin will show a message to user that will tell them that limit has been reached. In addition, the message will show how soon fresh tweets will be available again. If you don't check the box the message will not be shown - the tweets just won't be refreshed until plugin is able to get fresh data. 
     642                <?php _e('When the API connection limit is reached and there is no cached data Tweet Blender can not show new tweets. If you check this box the plugin will show a message to user that will tell them that limit has been reached. In addition, the message will show how soon fresh tweets will be available again. If you do not check the box the message will not be shown - the tweets just will not be refreshed until plugin is able to get fresh data.', 'tweetblender' ); ?> 
    618643            </span> 
    619644            </th> 
     
    623648            <label for="advanced_disable_cache"> 
    624649            <input type="checkbox" name="advanced_disable_cache" <?php checked('on', $tb_o['advanced_disable_cache']); ?>/> 
    625             <?php _e('Disable data caching', 'mt_trans_domain' ); ?>  
     650            <?php _e('Disable data caching', 'tweetblender' ); ?>  
    626651            </label><br/> 
    627652            <span class="setting-description"> 
    628                 Every time Tweet Blender refreshes, it stores data it receives from Twitter into a special cache on your server. Once a user reaches his API connection limit TweetBlender starts using cached data. Cached data is centralized and is updated by all users so even if one user is at a limit s/he can still get fresh tweets as cache is updated by other users that haven't yet reached their limit. If you don't want to cache data (to save bandwidth or for some other reason) then check this box. <b>WARNING: clears all cached tweets</b>. 
     653                <?php _e('Every time Tweet Blender refreshes, it stores data it receives from Twitter into a special cache on your server. Once a user reaches his API connection limit Tweet Blender starts using cached data. Cached data is centralized and is updated by all users so even if one user is at a limit s/he can still get fresh tweets as cache is updated by other users that have not yet reached their limit. If you do not want to cache data (to save bandwidth or for some other reason) then check this box.', 'tweetblender' );  echo '<b>' . __('Important','tweetblender') . ': ' . __('clears all cached tweets','tweetblender') . '</b>.'; ?> 
    629654            </span> 
    630655            </th> 
    631656        </tr> 
    632657        <tr valign="top"> 
    633             <th scope="row"><label for="general_timestamp_format"><?php _e('Timestamp Format', 'mt_trans_domain' ); ?>: 
     658            <th scope="row"><label for="general_timestamp_format"><?php _e('Timestamp Format', 'tweetblender' ); ?>: 
    634659            </label></th> 
    635660            <td><input type="text" name="general_timestamp_format" value="<?php if (isset($tb_o['general_timestamp_format'])) { echo $tb_o['general_timestamp_format']; } ?>"/> <span class="setting-description"><br/> 
    636                 leave blank = verbose from now ("4 minutes ago")<br/> 
    637                 h = 12-hour format of an hour with leading zeros ("08")<br/> 
    638                 i = Minutes with leading zeros ("01")<br/> 
    639                 s = Seconds, with leading zeros ("01")<br/> 
    640                 <a href="http://kirill-novitchenko.com/2009/05/configure-timestamp-format/">additional format options &raquo;</a> 
     661                <?php _e('leave blank = verbose from now ("4 minutes ago")', 'tweetblender' ); ?><br/> 
     662                <?php _e('h = 12-hour format of an hour with leading zeros ("08")', 'tweetblender' ); ?><br/> 
     663                <?php _e('i = Minutes with leading zeros ("01")', 'tweetblender' ); ?><br/> 
     664                <?php _e('s = Seconds, with leading zeros ("01")', 'tweetblender' ); ?><br/> 
     665                <a href="http://php.net/manual/en/function.date.php"><?php _e('additional format options', 'tweetblender' ); ?> &raquo;</a> 
    641666            </span></td> 
    642667        </tr> 
     
    646671            <label for="reset_oauth"> 
    647672            <input type="checkbox" name="reset_oauth" value="1"> 
    648             <?php _e('Clear oAuth Access Tokens', 'mt_trans_domain' ); ?>  
     673            <?php _e('Clear oAuth Access Tokens', 'tweetblender' ); ?>  
    649674            </label><br/> 
    650675            <span class="setting-description"> 
    651                 To get tweets from private users Tweet Blender needs to login to twitter using your credentials. Once you authorize access, the special tokens are stored in the configuration settings. This is NOT a username or password. Your username/password is NOT stored.  The tokens are tied to a specific Twitter account so if you changed your account or would like to use another account for authentication check this box to have previously saved tokens cleared. 
     676                <?php _e('To get tweets from private users Tweet Blender needs to login to twitter using your credentials. Once you authorize access, the special tokens are stored in the configuration settings. This is NOT a username or password. Your username/password is NOT stored.  The tokens are tied to a specific Twitter account so if you changed your account or would like to use another account for authentication check this box to have previously saved tokens cleared.', 'tweetblender' ); ?> 
    652677            </span> 
    653678            </th> 
     
    658683            <label for="advanced_no_search_api"> 
    659684            <input type="checkbox" name="advanced_no_search_api" <?php checked('on', $tb_o['advanced_no_search_api']); ?>/> 
    660             <?php _e('Do not use search API for screen names', 'mt_trans_domain' ); ?>  
     685            <?php _e('Do not use search API for screen names', 'tweetblender' ); ?>  
    661686            </label><br/> 
    662687            <span class="setting-description"> 
    663                 To get tweets for screen names Tweet Blender relies on Twitter Search API; however, sometimes Twitter's search does not return any tweets for a particular account due to some complex internal relevancy rules. If you see tweets for a user when looking at http://twitter.com/{someusername} but you do not see tweets for that same user when you look at http://search.twitter.com/search?q={@someusername} you can try to check this box and have Tweet Blender switch to a different API to retrieve recent tweets. <b>Important: screen names with modifiers (e.g. @user|#topic) will still use Search API.</b> 
     688                <?php _e("To get tweets for screen names Tweet Blender relies on Twitter Search API; however, sometimes Twitter's search does not return any tweets for a particular account due to some complex internal relevancy rules. If you see tweets for a user when looking at http://twitter.com/{someusername} but you do not see tweets for that same user when you look at http://search.twitter.com/search?q={@someusername} you can try to check this box and have Tweet Blender switch to a different API to retrieve recent tweets.", 'tweetblender' ); echo '<b>' . __('Important','tweetblender') . ': ' . __('screen names with modifiers (e.g. @user|#topic), keywords, and hastagas will still use Search API','tweetblender') . '</b>.'; ?> 
    664689            </span> 
    665690            </th> 
     
    672697        <table class="form-table"> 
    673698        <tr> 
    674             <th>API requests from blog server:</th> 
     699            <th><?php _e('API requests from blog server', 'tweetblender' ); ?>:</th> 
    675700            <td><?php 
    676701                if ($api_limit_data) { 
    677                     echo 'Max is ' . $api_limit_data->hourly_limit . '/hour &middot; '; 
     702                    echo sprintf(__('Max is %d/hour', 'tweetblender') . ' &middot; ', $api_limit_data->hourly_limit); 
    678703                    if ($api_limit_data->remaining_hits > 0) { 
    679                         echo 'You have <span class="pass">' . $api_limit_data->remaining_hits . '</span> left &middot; '; 
     704                        echo sprintf(__('You have %s left', 'tweetblender') . ' &middot; ','<span class="pass">' . $api_limit_data->remaining_hits . '</span>') ; 
    680705                    } 
    681706                    else { 
    682                         echo 'You have <span class="fail">0</span> left &middot; '; 
    683                     } 
    684                     echo "Next reset " . tb_verbal_time($api_limit_data->reset_time_in_seconds); 
     707                        echo sprintf(__('You have %s left', 'tweetblender') . ' &middot; <span class="fail">'. 0 . '</span>') ; 
     708                    } 
     709                    echo __('Next reset', 'tweetblender') . ' ' . tb_verbal_time($api_limit_data->reset_time_in_seconds); 
    685710                } 
    686711                else { 
    687                     echo '<span class="fail">Check failed</span>'; 
     712                    echo '<span class="fail">' . __('Check failed', 'tweetblender') . '</span>'; 
    688713                } 
    689714                if (isset($tb_o['advanced_reroute_on']) && ($tb_o['advanced_reroute_on'] && $tb_o['advanced_reroute_type'] == 'oauth')) { 
    690                     echo '<br/>checked with user account (oAuth)'; 
     715                    echo '<br/>' . __('checked with user account (oAuth)', 'tweetblender'); 
    691716                } 
    692717                else { 
    693                     $server_address = '[IP NOT AVAILABLE]'; 
    694                     if (isset($_SERVER['SERVER_ADDR'])) $server_address = esc_attr($_SERVER['SERVER_ADDR']); 
    695                     echo '<br/>checked with IP of your server (' . $server_address . ')'; 
     718                    $server_address = __('[IP NOT AVAILABLE]', 'tweetblender'); 
     719                    if (isset($_SERVER['SERVER_ADDR'])) { 
     720                            $server_address = esc_attr($_SERVER['SERVER_ADDR']); 
     721                    } 
     722                    echo '<br/>' . __('checked with IP of your server','tweetblender') . ' (' . $server_address . ')'; 
    696723                } 
    697724            ?></td> 
    698725        </tr> 
    699726        <tr> 
    700             <th>API requests from your computer:</th> 
     727            <th><?php _e('API requests from your computer', 'tweetblender' ); ?>:</th> 
    701728            <td id="locallimit"></td> 
    702729        </tr> 
    703730        <tr> 
    704             <th>oAuth Access Tokens:</th> 
     731            <th><?php _e('oAuth Access Tokens', 'tweetblender' ); ?>:</th> 
    705732            <td><?php  
    706733            if(isset($tb_o['oauth_access_token'])) { 
    707                 echo '<span class="pass">Present</span>'; 
     734                echo '<span class="pass">' . __('Present', 'tweetblender') . '</span>'; 
    708735            } 
    709736            elseif (!empty($have_private_sources) && !isset($tb_o['oauth_access_token'])) { 
    710                 echo '<span class="fail">Not Present</span>'; 
     737                echo '<span class="fail">' . __('Not Present', 'tweetblender') . '</span>'; 
    711738            } 
    712739            else { 
    713                 echo 'Not Needed'; 
     740                echo __('Not Needed' , 'tweetblender'); 
    714741            } 
    715742            ?></td> 
    716743        </tr> 
    717744        <tr> 
    718             <th>Cache:</th> 
     745            <th><?php _e('Cache', 'tweetblender' ); ?>:</th> 
    719746            <td> 
    720747                <?php    
    721748                 
    722749                if ($cached_sources = tb_get_cache_stats()) { 
    723                     //print_r($cached_sources); 
    724                     // Output each opened file and then close 
     750                    // Output each opened file and then close 
    725751                    foreach ((array)$cached_sources as $cache_src) { 
    726                         $s = ''; 
     752                        $s = __("tweet",'tweetblender'); 
    727753                        if ($cache_src->tweets_num != 1) { 
    728                             $s = 's'; 
     754                            $s = __("tweets",'tweetblender'); 
    729755                        } 
    730756                        echo '<input type="checkbox" name="delete_cache_src[]" value="' . esc_attr($cache_src->source) . '" /> ';                    
    731                         echo urldecode($cache_src->source) . " - " . $cache_src->tweets_num . " tweet$s - updated " . tb_verbal_time($cache_src->last_update) . '<br/>'; 
    732                     } 
    733                     echo '<label for="delete_cache_src[]">&nbsp;&uarr; Check boxes above to clear cached tweets from the database</label>'; 
     757                        echo urldecode($cache_src->source) . " - " . $cache_src->tweets_num . " $s - " . __("updated",'tweetblender') . ' ' . tb_verbal_time($cache_src->last_update) . '<br/>'; 
     758                    } 
     759                    echo '<label for="delete_cache_src[]"> &nbsp;&uarr; ' . __('Check the boxes above to clear cached tweets from the database', 'tweetblender') . '</label>'; 
    734760                } 
    735761                elseif ($tb_o['advanced_disable_cache'] == false) { 
    736                     echo '<span class="fail">no cached tweets found and caching is ON</span>'; 
     762                    echo '<span class="fail">' . __('no cached tweets found and caching is ON', 'tweetblender') . '</span>'; 
    737763                } 
    738764                else { 
    739                     echo '<span class="pass">no cached tweets found and caching is OFF</span>'; 
     765                    echo '<span class="pass">' . __('no cached tweets found and caching is OFF', 'tweetblender') . '</span>'; 
    740766                } 
    741767 
     
    755781    ?> 
    756782     
    757     <h2>Cache Manager Is Not Installed</h2> 
     783    <h2><?php _e('Cache Manager Is Not Installed', 'tweetblender' ); ?></h2> 
    758784    <div class="box-left"> 
    759     <p>Install Cache Manager add-on for Tweet Blender and instantly take advantage of the following features:</p> 
     785    <p><?php _e('Install Cache Manager addon for Tweet Blender and instantly take advantage of the following features', 'tweetblender' ); ?>:</p> 
    760786    <ol class="feature-set"> 
    761         <li>See all the tweets stored in your cache database</li> 
    762         <li>Delete individual tweets or groups of tweets</li> 
    763         <li>Backup and restore your cache</li> 
     787        <li><?php _e('See all the tweets stored in your cache database', 'tweetblender' ); ?></li> 
     788        <li><?php _e('Delete individual tweets or groups of tweets', 'tweetblender' ); ?></li> 
     789        <li><?php _e('Backup and restore your cache', 'tweetblender' ); ?></li> 
    764790    </ol> 
    765     <p>Click the button below to purchase the add-on for a <b>one time flat fee of $2.99</b>. This will perform a one-click install of a new plugin and you will get FREE upgrades with new features in the future.</p> 
     791    <p><?php echo sprintf(__('Click the button below to purchase the addon for a <b>one time flat fee of $%s</b>. This will perform a one-click install of a new plugin and you will get FREE upgrades with new features in the future.', 'tweetblender' ),'2.99'); ?></p> 
    766792    <div class="centered"> 
    767793        <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
     
    781807        <input type="hidden" name="cbt" value="Return to your site to complete installation" /> 
    782808        <input type="hidden" name="cancel_return" value="<?php echo tb_get_current_page_url(); ?>#tab-7" /> 
    783         <input type="submit" name="submit" class="button-secondary" value="Get Cache Manager" /> 
     809        <input type="submit" name="submit" class="button-secondary" value="<?php _e('Get Cache Manager', 'tweetblender' ); ?>" /> 
    784810        <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" /> 
    785811    </form> 
     
    795821        } else if(!$tb_active_addons[1]) {  
    796822    ?> 
    797     <h2>Cache Manager Is Not Active</h2> 
    798     <p>You have the Cache Manager plugin installed but not activated. Please use the [Plugins] menu on the left to activate the plugin</p> 
     823    <h2><?php _e('Cache Manager Is Not Active', 'tweetblender' ); ?></h2> 
     824    <p><?php _e('You have the Cache Manager plugin installed but not activated. Please use the [Plugins] menu on the left to activate the plugin', 'tweetblender' ); ?></p> 
    799825 
    800826    <?php 
     
    808834 
    809835    <div id="tab-8"> 
    810     Get Satisfaction Community: <a href="http://getsatisfaction.com/tweet_blender">http://getsatisfaction.com/tweet_blender</a><br/> 
    811     Facebook Fan Page: <a href="http://www.facebook.com/pages/Tweet-Blender/96201618006">http://www.facebook.com/pages/Tweet-Blender/96201618006</a><br/> 
    812     Twitter: <a href="http://twitter.com/tweetblender">http://twitter.com/tweetblender</a><br/> 
    813     Homepage: <a href="http://www.tweetblender.com">http://www.tweetblender.com</a><br/> 
     836    <?php _e('GetSatisfaction.com Community', 'tweetblender' ); ?>: <a href="http://getsatisfaction.com/tweet_blender">http://getsatisfaction.com/tweet_blender</a><br/> 
     837    <?php _e('Facebook Page', 'tweetblender' ); ?>: <a href="http://www.facebook.com/pages/Tweet-Blender/96201618006">http://www.facebook.com/pages/Tweet-Blender/96201618006</a><br/> 
     838    <?php _e('Twitter', 'tweetblender' ); ?>: <a href="http://twitter.com/tweetblender"> http://twitter.com/tweetblender</a><br/> 
     839    <?php _e('Homepage', 'tweetblender' ); ?>: <a href="http://www.tweetblender.com">http://www.tweetblender.com</a><br/> 
    814840    </div> 
    815841 
     
    817843 
    818844    <p class="submit"> 
    819     <input id="btn_save_settings" type="button" class="button-primary" value="<?php _e('Save Settings', 'mt_trans_domain' ) ?>" /> 
     845    <input id="btn_save_settings" type="button" class="button-primary" value="<?php _e('Save Settings', 'tweetblender' ) ?>" /> 
    820846    </p> 
    821847</div> 
  • tweet-blender/trunk/js/admin.js

    r350819 r381114  
    11/** 
    22 * @author kirill 
     3 *  
     4 * v3.3.6 
    35 */ 
    4 var TB_monthNumber = {'Jan':1,'Feb':2,'Mar':3,'Apr':4,'May':5,'Jun':6,'Jul':7,'Aug':8,'Sep':9,'Oct':10,'Nov':11,'Dec':12}, 
    5 TB_timePeriods = new Array("second", "minute", "hour", "day", "week", "month", "year", "decade"), 
    6 TB_timePeriodLengths = new Array("60","60","24","7","4.35","12","10"), 
    7 ajaxURLs = new Array(), 
     6var ajaxURLs = new Array(), 
    87screenNamesCount = 0; 
    98   
     
    4847        } 
    4948    }); 
     49     
     50    // bind event handler to mutually exclusive filters 
     51    jQuery('#filter_hide_replies').click(function() { 
     52        if (jQuery(this).is(':checked')) { 
     53            jQuery('#filter_hide_not_replies').removeAttr('checked'); 
     54        } 
     55    }); 
     56    jQuery('#filter_hide_not_replies').click(function() { 
     57        if (jQuery(this).is(':checked')) { 
     58            jQuery('#filter_hide_replies').removeAttr('checked'); 
     59        } 
     60    }); 
    5061 
    5162    // check limit for admin's PC 
     
    6172                hitsLeftHtml = '<span class="fail">0</span>'; 
    6273            } 
    63             jQuery('#locallimit').html('Max is ' + json.hourly_limit + '/hour &middot; You have ' + hitsLeftHtml + ' left &middot; Next reset ' + TB_verbalTime(TB_str2date(json.reset_time))); 
     74            jQuery('#locallimit').html( 
     75                TB_labels.limit_num.format(json.hourly_limit) + ' &middot; ' +  
     76                TB_labels.limit_left.format(hitsLeftHtml) + ' &middot; ' +  
     77                TB_labels.limit_reset + TB_verbalTime(TB_str2date(json.reset_time)) 
     78            ); 
    6479        }, 
    6580        error: function(){ 
    66             jQuery('#locallimit').html('<span class="fail">Check failed</span>'); 
     81            jQuery('#locallimit').html('<span class="fail">' + TB_labels.check_fail + '</span>'); 
    6782        } 
    6883    });  
     
    96111    var tWin = window.open(url,'tWin','width=800,height=410,toolbar=0,location=1,status=0,menubar=0,resizable=1'); 
    97112} 
    98  
    99 function TB_str2date(dateString) { 
    100  
    101     var dateObj = new Date(), 
    102     dateData = dateString.split(/[\s\:]/); 
    103      
    104     // if it's a search format 
    105     if (dateString.indexOf(',') >= 0) { 
    106         // $wday,$mday, $mon, $year, $hour,$min,$sec,$offset 
    107         dateObj.setUTCFullYear(dateData[3],TB_monthNumber[""+dateData[2]]-1,dateData[1]); 
    108         dateObj.setUTCHours(dateData[4],dateData[5],dateData[6]); 
    109     } 
    110     // if it's a user feed format 
    111     else { 
    112         // $wday,$mon,$mday,$hour,$min,$sec,$offset,$year 
    113         dateObj.setUTCFullYear(dateData[7],TB_monthNumber[""+dateData[1]]-1,dateData[2]); 
    114         dateObj.setUTCHours(dateData[3],dateData[4],dateData[5]); 
    115     } 
    116  
    117     return dateObj; 
    118 } 
    119  
    120 function TB_verbalTime(dateObj) { 
    121     
    122     var j, 
    123     now = new Date(), 
    124     difference, 
    125     verbalTime, 
    126     prefix = '', 
    127     postfix = ''; 
    128      
    129     if (now.getTime() > dateObj.getTime()) { 
    130         difference = Math.round((now.getTime() - dateObj.getTime()) / 1000); 
    131         postfix = ' ago'; 
    132     } 
    133     else { 
    134         difference = Math.round((dateObj.getTime() - now.getTime()) / 1000); 
    135         prefix = 'in '; 
    136     } 
    137          
    138     
    139     for(j = 0; difference >= TB_timePeriodLengths[j] && j < TB_timePeriodLengths.length; j++) { 
    140         difference = difference / TB_timePeriodLengths[j]; 
    141     } 
    142     difference = Math.round(difference); 
    143     
    144     verbalTime = TB_timePeriods[j]; 
    145     if (difference != 1) { 
    146         verbalTime += 's'; 
    147     } 
    148     
    149     return prefix + difference + ' ' + verbalTime + postfix; 
    150 } 
  • tweet-blender/trunk/js/main.js

    r357092 r381114  
    33 */ 
    44 
    5 var TB_version = '3.3.5',   // Plugin version  
     5var TB_version = '3.3.6',   // Plugin version  
    66TB_rateLimitData, 
    77TB_tmp, 
    88TB_mode = 'widget', 
    99TB_started = false, 
    10 TB_monthNumber = {'Jan':1,'Feb':2,'Mar':3,'Apr':4,'May':5,'Jun':6,'Jul':7,'Aug':8,'Sep':9,'Oct':10,'Nov':11,'Dec':12}, 
    11 TB_timePeriods = new Array("second", "minute", "hour", "day", "week", "month", "year", "decade"), 
    12 TB_timePeriodLengths = new Array("60","60","24","7","4.35","12","10"), 
    1310TB_tweetsToCache = new Object(), 
    1411TB_allSources = new Array(), 
     
    3128    // check to make sure config is included 
    3229    if (typeof(TB_config) == 'undefined') { 
    33         TB_showMessage(null,'noconf','No configuration settings found.',true); 
     30        TB_showMessage(null,'noconf',js_labels.no_config,true); 
    3431        return; 
    3532    } 
     
    6865        TB_config.widgets[widgetId] = new Object; 
    6966         
    70         // set all properties (backward compatibility) 
    71         jQuery.each(jQuery('#'+widgetConfId).children('input'),function(j,property) { 
    72             TB_config.widgets[widgetId][property.name] = property.value; 
    73         }); 
    7467        // set all properties 
    75         jQuery.each(jQuery('#'+widgetConfId + ' > div').children('input'),function(j,property) { 
     68        jQuery.each(jQuery('#'+widgetConfId).find('input'),function(j,property) { 
    7669            TB_config.widgets[widgetId][property.name] = property.value; 
    7770        }); 
     
    8477            // add widget HTML 
    8578            widgetHTML = '<div id="' + widgetId + '-mc"><div class="tb_header">' + 
    86                 '<img class="tb_twitterlogo" src="' + TB_pluginPath + '/img/twitter-logo.png" alt="Twitter Logo" />' + 
     79                '<img class="tb_twitterlogo" src="' + TB_pluginPath + '/img/twitter-logo.png" alt="' + js_labels.twitter_logo + '" />' + 
    8780                '<div class="tb_tools" style="background-image:url(' + TB_pluginPath + '/img/bg_sm.png)">' + 
    88                 '<a class="tb_infolink" href="http://kirill-novitchenko.com" title="Tweet Blender by Kirill Novitchenko" style="background-image:url(' + TB_pluginPath + '/img/info-kino.png)"> </a>' + 
    89                 '<a class="tb_refreshlink" href="javascript:TB_blend(\'' + widgetId + '\');" title="Refresh Tweets"><img src="' + TB_pluginPath + '/img/ajax-refresh-icon.gif" alt="Refresh" /></a></div></div>'; 
     81                '<a class="tb_infolink" href="http://kirill-novitchenko.com" title="' + js_labels.kino + '" style="background-image:url(' + TB_pluginPath + '/img/info-kino.png)"> </a>' + 
     82                '<a class="tb_refreshlink" href="javascript:TB_blend(\'' + widgetId + '\');" title="' + js_labels.refresh + '"><img src="' + TB_pluginPath + '/img/ajax-refresh-icon.gif" alt="' + js_labels.refresh + '" /></a></div></div>'; 
    9083            if (TB_config.general_seo_tweets_googleoff) { 
    9184                tweetHTML += '<!--googleoff: index--><div class="tb_tweetlist"></div><!--googleon: index-->'; 
     
    154147             
    155148            if (typeof(TB_config.widgets[widgetId].sources) == 'undefined' || TB_config.widgets[widgetId].sources == '') { 
    156                 TB_showMessage(widgetId,'nosrc','Twitter sources to blend are not defined', true); 
    157                  
    158                 // TODO: disable refresh 
    159                 //jQuery('#refreshlink').remove(); 
     149                TB_showMessage(widgetId,'nosrc',js_labels.no_sources, true); 
    160150            } 
    161151            else { 
     
    204194    } 
    205195    else { 
    206         TB_showMessage(null,'noconf','Cannot retrieve Tweet Blender configuration options',true); 
     196        TB_showMessage(null,'noconf',js_labels.no_global_config,true); 
    207197     
    208198        // disable refresh 
     
    245235            // if we are serving only favorites 
    246236            if (TB_config.widgets[widgetId].favoritesOnly) { 
    247                 TB_addAjaxUrl(widgetId,'favorites',{'screen_name':screenName},src,1); 
     237                TB_addAjaxUrl(widgetId,'favorites',{'screen_name':screenName},src,1,null); 
    248238            } 
    249239            // if we are not using Search API 
    250240            else if (TB_config.advanced_no_search_api) { 
    251                 TB_addAjaxUrl(widgetId,'user_timeline',{'screen_name':screenName},src,1); 
     241                TB_addAjaxUrl(widgetId,'user_timeline',{'screen_name':screenName},src,1,null); 
    252242            } 
    253243            else { 
    254                 TB_addAjaxUrl(widgetId,'search',{'from':screenName},src,1); 
     244                TB_addAjaxUrl(widgetId,'search',{'from':screenName},src,1,null); 
    255245            } 
    256246        } 
     
    271261                } 
    272262 
    273                 TB_addAjaxUrl(widgetId,'favorites',{'screen_name':screenName},src,0); 
     263                TB_addAjaxUrl(widgetId,'favorites',{'screen_name':screenName},src,0,null); 
    274264            } 
    275265            // if it includes modifiers, use a one-off URL 
     
    290280                // if modifier is a hashtag 
    291281                if (modifier.charAt(0) == '#') { 
    292                     TB_addAjaxUrl(widgetId,'search',{'from':screenName,'tag':modifier.substr(1)},src,0); 
    293                 } 
     282                    TB_addAjaxUrl(widgetId,'search',{'from':screenName,'tag':modifier.substr(1)},src,0,modifier); 
     283                } 
     284                // else modifier is just a keyword 
    294285                else { 
    295                     TB_addAjaxUrl(widgetId,'search',{'from':screenName,'ors':modifier},src,0); 
     286                    TB_addAjaxUrl(widgetId,'search',{'from':screenName,'ors':modifier},src,0,modifier); 
    296287                } 
    297288            } 
     
    311302                // if we are not using Search API 
    312303                if (TB_config.advanced_no_search_api) { 
    313                     TB_addAjaxUrl(widgetId,'user_timeline',{'screen_name':screenName},src,0); 
     304                    TB_addAjaxUrl(widgetId,'user_timeline',{'screen_name':screenName},src,0,null); 
    314305                } 
    315306                // else, group with other screen names 
     
    317308                    // check to make sure we are not over the query length limit 
    318309                    if (escape(TB_screenNameQueries.join(' OR ')).length + src.length > 140) { 
    319                         TB_addAjaxUrl(widgetId,'search',{'q':TB_screenNameQueries.join(' OR ')},escape('@'+TB_screenNames.join(',@')),0); 
     310                        TB_addAjaxUrl(widgetId,'search',{'q':TB_screenNameQueries.join(' OR ')},escape('@'+TB_screenNames.join(',@')),0,null); 
    320311                        TB_screenNames = new Array(); 
    321312                        TB_screenNameQueries = new Array(); 
     
    333324        // if it's a list 
    334325        else if (src.charAt(0) == '@' && src.indexOf('/') > 1) { 
    335             TB_addAjaxUrl(widgetId,'list_timeline',{'user':src.substr(1, src.indexOf('/') - 1),'list':src.substr(src.indexOf('/') + 1)},src,0); 
     326             
     327            // if we have a modifier 
     328            if ((pipePos = src.indexOf('|')) > 1) { 
     329                 
     330                TB_addAjaxUrl(widgetId, 'list_timeline', { 
     331                    'user': src.substr(1, src.indexOf('/') - 1), 
     332                    'list': src.substr(src.indexOf('/') + 1, pipePos - src.indexOf('/') - 1) 
     333                }, src, 0, src.substr(pipePos+1)); 
     334            } 
     335            // if it's just a regular list 
     336            else { 
     337                TB_addAjaxUrl(widgetId, 'list_timeline', { 
     338                    'user': src.substr(1, src.indexOf('/') - 1), 
     339                    'list': src.substr(src.indexOf('/') + 1) 
     340                }, src, 0, null); 
     341            } 
    336342        } 
    337343        // else it's a hash or keyword  
     
    348354            // check to make sure we are not over the query length limit 
    349355            if (TB_searchTerms.join(' OR ').length + src.length > 140) { 
    350                 TB_addAjaxUrl(widgetId,'search',{'q':TB_searchTerms.join(' OR ')},TB_searchTerms.join(','),0); 
     356                TB_addAjaxUrl(widgetId,'search',{'q':TB_searchTerms.join(' OR ')},TB_searchTerms.join(','),0,null); 
    351357                TB_searchTerms = new Array(); 
    352358            } 
     
    357363    // if there are terms that are not part of a query - add another query 
    358364    if (TB_searchTerms.length > 0) { 
    359         TB_addAjaxUrl(widgetId,'search',{'q':TB_searchTerms.join(' OR ')},TB_searchTerms.join(','),0); 
     365        TB_addAjaxUrl(widgetId,'search',{'q':TB_searchTerms.join(' OR ')},TB_searchTerms.join(','),0,null); 
    360366    } 
    361367     
    362368    // if there are screenNames - join them into a single query 
    363369    if (TB_screenNames.length > 0) { 
    364         TB_addAjaxUrl(widgetId,'search',{'q':TB_screenNameQueries.join(' OR ')},encodeURI('@'+TB_screenNames.join(',@')),0); 
    365     } 
    366 } 
    367  
    368 function TB_addAjaxUrl(widgetId,actionType,queryData,src,isPrivateSrc) { 
     370        TB_addAjaxUrl(widgetId,'search',{'q':TB_screenNameQueries.join(' OR ')},encodeURI('@'+TB_screenNames.join(',@')),0,null); 
     371    } 
     372} 
     373 
     374function TB_addAjaxUrl(widgetId,actionType,queryData,src,isPrivateSrc,modifier) { 
     375     
     376    var url; 
    369377     
    370378    // check language filter     
     
    378386    // check private 
    379387    if (isPrivateSrc) { 
    380         queryData.private  = 1; 
     388        queryData.private = 1; 
    381389    } 
    382390 
     
    388396            'source':src, 
    389397            'privateSrc':isPrivateSrc, 
    390             'dtype':'json' 
     398            'dtype':'json', 
     399            'modifier':modifier 
    391400        }); 
    392401    } 
    393402    else if (actionType == 'search') { 
    394         queryData.rpp = TB_config.widgets[widgetId]['tweetsNum']; 
     403        queryData.rpp = TB_config.widgets[widgetId]['tweetsNum'] * 2; 
    395404        TB_config.widgets[widgetId]['ajaxURLs'].push({ 
    396405            'url': 'http://search.twitter.com/search.json', 
     
    398407            'source':src, 
    399408            'privateSrc':0, 
    400             'dtype':'jsonp' 
     409            'dtype':'jsonp', 
     410            'modifier':modifier 
    401411        }); 
    402412    } 
    403413    else if (actionType == 'list_timeline' && (TB_config.advanced_reroute_on || TB_config.reached_api_limit)) { 
    404414        queryData.action = actionType; 
     415 
     416        // remove unneeded params 
     417        delete queryData.user; 
     418        delete queryData.list; 
    405419        delete queryData.nots; 
    406420        delete queryData.lang; 
     421 
    407422        TB_config.widgets[widgetId]['ajaxURLs'].push({ 
    408423            'url':TB_pluginPath + '/ws.php', 
     
    410425            'source':src, 
    411426            'privateSrc':0, 
    412             'dtype':'json' 
     427            'dtype':'json', 
     428            'modifier':modifier 
    413429        }); 
    414430    } 
    415431    else if (actionType == 'list_timeline'){ 
    416         queryData.per_page = TB_config.widgets[widgetId]['tweetsNum']; 
     432        url = 'http://api.twitter.com/1/' + queryData.user + '/lists/' + queryData.list + '/statuses.json'; 
     433 
     434        // remove unneeded params 
     435        delete queryData.user; 
     436        delete queryData.list; 
     437        delete queryData.nots; 
     438        delete queryData.lang; 
     439         
     440        queryData.per_page = TB_config.widgets[widgetId]['tweetsNum']  * 2; 
    417441        TB_config.widgets[widgetId]['ajaxURLs'].push({ 
    418             'url':'http://api.twitter.com/1/' + queryData.user + '/lists/' + queryData.list + '/statuses.json', 
     442            'url':url, 
    419443            'data':queryData, 
    420444            'source':src, 
    421445            'privateSrc':0, 
    422             'dtype':'jsonp' 
     446            'dtype':'jsonp', 
     447            'modifier':modifier 
    423448        }); 
    424449    } 
     
    430455            'source':src, 
    431456            'privateSrc':0, 
    432             'dtype':'json' 
     457            'dtype':'json', 
     458            'modifier':modifier 
    433459        }); 
    434460    } 
     
    439465            'source':src, 
    440466            'private':0, 
    441             'dtype':'jsonp' 
     467            'dtype':'jsonp', 
     468            'modifier':modifier 
    442469        }); 
    443470    } 
     
    449476            'source':src, 
    450477            'privateSrc':0, 
    451             'dtype':'json' 
     478            'dtype':'json', 
     479            'modifier':modifier 
    452480        }); 
    453481    } 
     
    458486            'source':src, 
    459487            'private':0, 
    460             'dtype':'jsonp' 
     488            'dtype':'jsonp', 
     489            'modifier':modifier 
    461490        }); 
    462491    } 
     
    495524    // add action to twitter logo 
    496525    jQuery('#' + widgetId + '-mc').children('div.tb_header').children('img.tb_twitterlogo').click(function(){ 
    497         TB_showMessage(widgetId,'info','Powered by Tweet Blender plugin v' + TB_version + ' blending ' + TB_config.widgets[widgetId].sourcesHTML,false); 
     526        TB_showMessage(widgetId,'info',js_labels.version_msg.format(TB_version,TB_config.widgets[widgetId].sourcesHTML),false); 
    498527    });  
    499528} 
     
    534563                    // if we reached limit, don't have cache turned on, and need to tell user - show message 
    535564                    else if (TB_config.advanced_show_limit_msg) { 
    536                         TB_showMessage(widgetId,'limit','You reached Twitter API connection limit. Next reset ' + TB_verbalTime(TB_str2date(json.reset_time)), false); 
     565                        TB_showMessage(widgetId,'limit',js_labels.limit_msg + '. ' + TB_labels.limit_reset.format(TB_verbalTime(TB_str2date(json.reset_time))), false); 
    537566                    } 
    538567                } 
     
    569598            else { 
    570599            */ 
    571                 TB_showMessage(widgetId, 'notweets', 'No tweets found for ' + TB_config.widgets[widgetId].sourcesHTML, true); 
     600                TB_showMessage(widgetId, 'notweets', TB_labels.no_tweets_msg.format(TB_config.widgets[widgetId].sourcesHTML), true); 
    572601        } 
    573602        else { 
     
    679708        tweets = jsonData.results; 
    680709    } 
    681      
     710console.log('adding tweets');    
    682711    jQuery.each(tweets,function(i,tweetJson) { 
    683712 
    684713        tb_tweet = new TB_tweet(tweetJson); 
     714        tb_tweet.modifier = urlInfo.modifier; 
    685715         
    686716        // make sure it's OK to show 
     
    688718            return true; 
    689719        } 
    690          
     720 
    691721        tb_tweet.selectRelevantSources(urlInfo.source); 
    692722                 
    693723        isNewTweet = false; 
    694          
     724 
    695725        // if this tweet already in the set, skip it 
    696726        tweetExists = false; 
     
    863893    // if there are not tweets, show loading message 
    864894    if(TB_config.widgets[widgetId].tweetsShown == 0) { 
    865         TB_showMessage(widgetId,'loading','Loading tweets...',true); 
     895        TB_showMessage(widgetId,'loading',TB_labels.loading_msg,true); 
    866896    } 
    867897    // show animated icon 
     
    908938    jQuery('#' + widgetId + '-mc').children('#msg_' + messageId).slideUp(1000,function(){jQuery('#' + widgetId + '-mc').children('#msg_' + messageId).remove()}); 
    909939} 
    910  
    911 // search: Wed, 27 May 2009 15:52:40 +0000 
    912 // user feed: Thu May 21 00:09:16 +0000 2009 
    913 function TB_str2date(dateString) { 
    914      
    915     var dateObj = new Date(), 
    916     dateData = dateString.split(/[\s\:]/); 
    917      
    918     // if it's a search format 
    919     if (dateString.indexOf(',') >= 0) { 
    920         // $wday,$mday, $mon, $year, $hour,$min,$sec,$offset 
    921         dateObj.setUTCFullYear(dateData[3],TB_monthNumber[""+dateData[2]]-1,dateData[1]); 
    922         dateObj.setUTCHours(dateData[4],dateData[5],dateData[6],0); 
    923     } 
    924     // if it's a user feed format 
    925     else { 
    926         // $wday,$mon,$mday,$hour,$min,$sec,$offset,$year 
    927         dateObj.setUTCFullYear(dateData[7],TB_monthNumber[""+dateData[1]]-1,dateData[2]); 
    928         dateObj.setUTCHours(dateData[3],dateData[4],dateData[5],0); 
    929     } 
    930  
    931     return dateObj; 
    932 } 
    933  
    934 function TB_verbalTime(dateObj) { 
    935     
    936     var j, 
    937     now = new Date(), 
    938     difference, 
    939     verbalTime, 
    940     prefix = '', 
    941     postfix = ''; 
    942      
    943     if (now.getTime() > dateObj.getTime()) { 
    944         difference = Math.round((now.getTime() - dateObj.getTime()) / 1000); 
    945         postfix = ' ago'; 
    946     } 
    947     else { 
    948         difference = Math.round((dateObj.getTime() - now.getTime()) / 1000); 
    949         prefix = 'in '; 
    950     } 
    951          
    952     
    953     for(j = 0; difference >= TB_timePeriodLengths[j] && j < TB_timePeriodLengths.length; j++) { 
    954         difference = difference / TB_timePeriodLengths[j]; 
    955     } 
    956     difference = Math.round(difference); 
    957     
    958     verbalTime = TB_timePeriods[j]; 
    959     if (difference != 1) { 
    960         verbalTime += 's'; 
    961     } 
    962     
    963     return prefix + difference + ' ' + verbalTime + postfix; 
    964 } 
    965  
    966 function TB_addLoadEvent(func) {  
    967     var oldonload = window.onload;  
    968     if (typeof window.onload != 'function') {  
    969         window.onload = func;  
    970     } else {  
    971         window.onload = function() {  
    972           oldonload();  
    973           func();  
    974         } 
    975     }  
    976 } 
    977  
    978 // function to get the size of an object 
    979 function TB_getObjectSize(obj) { 
    980     var size = 0, key; 
    981     for (key in obj) { 
    982         if (obj.hasOwnProperty(key)) size++; 
    983     } 
    984     return size; 
    985 } 
    986  
    987 // function to dedupe array 
    988 function TB_getUniqueElements(arr) { 
    989     var uniques = [], i, val; 
    990     for(i=arr.length;i--;){ 
    991         val = arr[i];   
    992         if(jQuery.inArray( val, uniques )===-1){ 
    993             uniques.unshift(val); 
    994         } 
    995     } 
    996     return uniques; 
    997 } 
    998  
    999 // Add format function to enable templates 
    1000 String.prototype.format = function() { 
    1001     var s = this, 
    1002         i = arguments.length; 
    1003  
    1004     while (i--) { 
    1005         s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]); 
    1006     } 
    1007     return s; 
    1008 }; 
    1009940 
    1010941// TB Class for tweets 
     
    10851016        // show source if requested 
    10861017        if (TB_config['widget_show_source'] && tweetJson.source) { 
    1087             template += ' from {6}'; 
     1018            template += ' ' + TB_labels.from + ' {6}'; 
    10881019        } 
    10891020        // end tweet footer 
     
    10961027            template += '<div class="tweet-tools" style="display:none;">'; 
    10971028            if (TB_config.widget_show_reply_link) { 
    1098                 template += '<a rel="nofollow" href="http://twitter.com/home?status=@{1}%20&in_reply_to_status_id={4}&in_reply_to={1}">reply</a>'; 
     1029                template += '<a rel="nofollow" href="http://twitter.com/home?status=@{1}%20&in_reply_to_status_id={4}&in_reply_to={1}">' + TB_labels.reply + '</a>'; 
    10991030            } 
    11001031            if (TB_config.widget_show_follow_link && TB_config.widget_show_reply_link) { 
     
    11021033            } 
    11031034            if (TB_config.widget_show_follow_link) { 
    1104                 template += '<a rel="nofollow" href="http://twitter.com/{1}">follow {1}</a>'; 
     1035                template += '<a rel="nofollow" href="http://twitter.com/{1}">' + TB_labels.follow + ' {1}</a>'; 
    11051036            } 
    11061037            template += '</div>';  
     
    12641195    this.isOKtoShow = function() { 
    12651196 
     1197        console.log('mod:'+this.modifier+' have it? ' + this.jsonCode.text.indexOf(this.modifier)); 
     1198        // if we have a modifier on that source and text contains it 
     1199        if (this.modifier) { 
     1200            if (this.modifier.length > 0 && this.jsonCode.text.indexOf(this.modifier) < 0) { 
     1201                return false; 
     1202            } 
     1203        } 
     1204         
    12661205        // if we don't show tweets with same content 
    12671206        if (TB_config.filter_hide_same_text) { 
  • tweet-blender/trunk/lib/lib.php

    r354049 r381114  
    11<?php 
    22 
    3 // Version 3.3.4 
     3// Version 3.3.6 
    44 
    55// aliases for sources 
     
    2323); 
    2424 
     25// options used only internally 
    2526$tb_option_names_system = array( 
    2627    'db_version' 
     
    2930// refresh periods in seconds 
    3031$tb_refresh_periods = array( 
    31     'Manual' => 0, 
    32     'Only once (on load)' => 1, 
    33     'Every 5 seconds' => 5, 
    34     'Every 10 seconds' => 10, 
    35     'Every 15 seconds' => 15, 
    36     'Every 20 seconds' => 20, 
    37     'Every 30 seconds' => 30, 
    38     'Every minute' => 60, 
    39     'Every 2 minutes' => 120, 
    40     'Every 5 minutes' => 300, 
    41     'Every 10 minutes' => 600, 
    42     'Every 20 minutes' => 1200, 
     32    __('Manual', 'tweetblender') => 0, 
     33    __('Only once (on load)', 'tweetblender') => 1, 
     34    sprintf(__('Every %d seconds', 'tweetblender'),5) => 5, 
     35    sprintf(__('Every %d seconds', 'tweetblender'),10) => 10, 
     36    sprintf(__('Every %d seconds', 'tweetblender'),15) => 15, 
     37    sprintf(__('Every %d seconds', 'tweetblender'),20) => 20, 
     38    sprintf(__('Every %d seconds', 'tweetblender'),30) => 30, 
     39    __('Every minute', 'tweetblender') => 60, 
     40    sprintf(__('Every %d minutes', 'tweetblender'),2) => 120, 
    4341); 
    4442 
    4543$tb_throttle_time_options = array( 
    46     'all time' => 0, 
    47     '1 minute' => 60, 
    48     '5 minutes' => 300, 
    49     '10 minutes' => 600, 
    50     '20 minutes' => 1200, 
    51     '30 minutes' => 1800, 
    52     '60 minutes' => 3600, 
    53     '90 minutes' => 5400, 
    54     '120 minutes' => 7200 
     44    __('all time', 'tweetblender') => 0, 
     45    '1 ' . __('minute', 'tweetblender') => 60, 
     46    '5 ' . __('minutes', 'tweetblender') => 300, 
     47    '10 ' . __('minutes', 'tweetblender') => 600, 
     48    '20 ' . __('minutes', 'tweetblender') => 1200, 
     49    '30 ' . __('minutes', 'tweetblender') => 1800, 
     50    '60 ' . __('minutes', 'tweetblender') => 3600, 
     51    '90 ' . __('minutes', 'tweetblender') => 5400, 
     52    '120 ' . __('minutes', 'tweetblender') => 7200 
    5553); 
    5654 
    5755$tb_keep_tweets_options = array( 
    58     'Do not delete them' => 0, 
    59     '1 day' => 1, 
    60     '2 days' => 2, 
    61     '3 days' => 3, 
    62     '1 week' => 7, 
    63     '2 weeks' => 14, 
    64     '1 month' => 30 
     56    __('Do not delete them', 'tweetblender') => 0, 
     57    '1 ' . __('day', 'tweetblender')    => 1, 
     58    '2 ' . __('days', 'tweetblender') => 2, 
     59    '3 ' . __('days', 'tweetblender') => 3, 
     60    '1 ' . __('week', 'tweetblender') => 7, 
     61    '2 ' . __('weeks', 'tweetblender') => 14, 
     62    '1 ' . __('month', 'tweetblender') => 30 
    6563); 
    6664 
    6765$tb_languages = array( 
    68 ' ' => 'any language', 
     66' ' => __('any language', 'tweetblender'), 
    6967'ab' => 'Abkhazian', 
    7068'ae' => 'Avestan', 
     
    235233$tb_addons = array( 
    236234    '1' => array( 
    237         'name' => 'Cache Manager', 
     235        'name' => __('Cache Manager', 'tweetblender'), 
    238236        'slug' => 'tweet-blender-cache-manager' 
    239237    ), 
    240238    '2' => array( 
    241         'name' => 'nStyle', 
     239        'name' => __('nStyle', 'tweetblender'), 
    242240        'slug' => 'tweet-blender-nstyle' 
    243241    ), 
    244242    '3' => array( 
    245         'name' => 'Tweet Injector', 
     243        'name' => __('Tweet Injector', 'tweetblender'), 
    246244        'slug' => 'tweet-blender-injector' 
    247245    ) 
     
    249247 
    250248$tb_package_names = array( 
    251     '1' => 'Cache Manager', 
    252     '2' => 'nStyle', 
    253     '3' => 'Tweet Injector' 
     249    '1' => __('Cache Manager', 'tweetblender'), 
     250    '2' => __('nStyle', 'tweetblender'), 
     251    '3' => __('Tweet Injector', 'tweetblender'), 
    254252); 
    255253 
     254$js_labels = array( 
     255    'no_config' => __('No configuration settings found', 'tweetblender'), 
     256    'twitter_logo' => __('Twitter Logo', 'tweetblender'), 
     257    'kino' => __('Development by Kirill Novitchenko', 'tweetblender'), 
     258    'refresh' => __('Refresh', 'tweetblender'), 
     259    'no_sources' => __('Twitter sources to blend are not defined', 'tweetblender'), 
     260    'no_global_config' => __('Cannot retrieve Tweet Blender configuration options', 'tweetblender'), 
     261    'version_msg' => __('Powered by Tweet Blender plugin v{0} blending {1}', 'tweetblender'), 
     262    'limit_msg' => __('You reached Twitter API connection limit', 'tweetblender'), 
     263    'no_tweets_msg' => __('No tweets found for {0}', 'tweetblender'), 
     264    'loading_msg' => __('Loading tweets...', 'tweetblender'), 
     265    'time_past' => __('{0} {1} ago', 'tweetblender'), 
     266    'time_future' => __('in {0} {1}', 'tweetblender'), 
     267    'second' => __('second', 'tweetblender'), 
     268    'seconds' => __('seconds', 'tweetblender'), 
     269    'minute' => __('minute', 'tweetblender'), 
     270    'minutes' => __('minutes', 'tweetblender'), 
     271    'hour' => __('hour', 'tweetblender'), 
     272    'hours' => __('hours', 'tweetblender'), 
     273    'day' => __('day', 'tweetblender'), 
     274    'days' => __('days', 'tweetblender'), 
     275    'week' => __('week', 'tweetblender'), 
     276    'weeks' => __('weeks', 'tweetblender'), 
     277    'month' => __('month', 'tweetblender'), 
     278    'months' => __('months', 'tweetblender'), 
     279    'year' => __('year', 'tweetblender'), 
     280    'years' => __('years', 'tweetblender'), 
     281    'check_fail' => __('Check failed', 'tweetblender'), 
     282    'limit_num' => __('Max is {0}/hour', 'tweetblender'), 
     283    'limit_left' => __('You have {0} left', 'tweetblender'), 
     284    'from' => __('from', 'tweetblender'), 
     285    'reply' => __('reply', 'tweetblender'), 
     286    'follow' => __('follow', 'tweetblender'), 
     287    'limit_reset' => __('Next reset','tweetblender') 
     288); 
    256289 
    257290function tb_get_url_content($url) 
     
    297330 
    298331function tb_verbal_time($timestamp) { 
    299     $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade"); 
    300     $lengths = array("60","60","24","7","4.35","12","10"); 
     332    $periods = array(__("second",'tweetblender'), __("minute",'tweetblender'), __("hour",'tweetblender'), __("day",'tweetblender'), __("week",'tweetblender'), __("month",'tweetblender'), __("year",'tweetblender')); 
     333    $periods_plural = array(__("seconds",'tweetblender'), __("minutes",'tweetblender'), __("hours",'tweetblender'), __("days",'tweetblender'), __("weeks",'tweetblender'), __("months",'tweetblender'), __("years",'tweetblender')); 
     334    $lengths = array("60","60","24","7","4.35","12"); 
    301335    
    302336    $now = time(); 
    303     $prefix = ""; $suffix = ""; 
    304     if ($timestamp < $now) { 
    305         $suffix = " ago"; 
    306     } 
    307     else { 
    308         $prefix = "in "; 
    309     } 
    310337    $difference = abs($now - $timestamp); 
    311338    
     
    316343    
    317344    if($difference != 1) { 
    318         $periods[$j] .= "s"; 
     345        $units = $periods_plural[$j]; 
    319346    } 
    320     
    321     return $prefix . "$difference $periods[$j]" . $suffix; 
     347    else { 
     348        $units = $periods[$j]; 
     349    } 
     350 
     351    if ($timestamp < $now) { 
     352        return sprintf(__("%d %s ago",'tweetblender'), $difference, $units); 
     353    } 
     354    else { 
     355        return sprintf(__("in %d %s",'tweetblender'), $difference, $units); 
     356    } 
    322357} 
    323358 
     
    325360// user feed: Thu May 21 00:09:16 +0000 2009 
    326361function tb_str2time($date_string) { 
    327     $mnum = array( 
    328         'Jan' => 1,'Feb' => 2,'Mar' => 3,'Apr' => 4,'May' => 5,'Jun' => 6, 
    329         'Jul' => 7,'Aug' => 8,'Sep' => 9 ,'Oct' => 10,'Nov'=>11,'Dec'=>12); 
    330          
     362    $mnum = array('Jan' => 1,'Feb' => 2, 'Mar' => 3, 'Apr' => 4, 'May' => 5, 'Jun' => 6, 'Jul' => 7, 'Aug' => 8, 'Sep' => 9, 'Oct' => 10, 'Nov' => 11, 'Dec' => 12); 
     363 
    331364    if (strpos($date_string, ',') !== false) { 
    332365        list($wday,$mday, $mon, $year, $hour,$min,$sec,$offset) = preg_split('/[\s\:]/',$date_string); 
     
    446479                // TODO: make sure source is in the admin defined set 
    447480                // store the tweet only if it matches this particular keyword or hashtag or if this is for list/username 
    448                 if (strpos(strtolower($t->text),strtolower($src)) !== false || strpos($src, '@') === 0) { 
     481                if (strpos(strtolower($t->text),strtolower($src)) !== false || strpos($src, '@') === 0 || strtolower($src) == strtolower($t->from_user)) { 
    449482 
    450483                    $wpdb->query("INSERT IGNORE INTO $table_name (div_id,source,tweet_text,tweet_json) VALUES ('" .  
     
    645678    // show source if requested 
    646679    if ($tb_o[$mode . '_show_source'] && isset($tweet->source)) { 
    647         $tweet_template .= ' from {6}'; 
     680        $tweet_template .= ' ' . __('from','tweetblender') . ' {6}'; 
    648681    } 
    649682     
     
    658691        $tweet_template .= '<div class="tweet-tools" style="display:none;">'; 
    659692        if ($tb_o[$mode . '_show_reply_link']) { 
    660             $tweet_template .= '<a rel="nofollow" href="http://twitter.com/home?status=@{1}%20&in_reply_to_status_id={4}&in_reply_to={1}">reply</a>'; 
     693            $tweet_template .= '<a rel="nofollow" href="http://twitter.com/home?status=@{1}%20&in_reply_to_status_id={4}&in_reply_to={1}">' . __('reply','tweetblender') . '</a>'; 
    661694        } 
    662695        if ($tb_o[$mode . '_show_follow_link'] && $tb_o[$mode . '_show_reply_link']) { 
     
    664697        } 
    665698        if ($tb_o[$mode . '_show_follow_link']) { 
    666             $tweet_template .= '<a rel="nofollow" href="http://twitter.com/{1}">follow {1}</a>'; 
     699            $tweet_template .= '<a rel="nofollow" href="http://twitter.com/{1}">' . __('follow','tweetblender') . ' {1}</a>'; 
    667700        } 
    668701        $tweet_template .= '</div>';  
     
    718751              'post_type' => 'page', 
    719752              'post_author' => 1, 
    720               'post_title' => 'Twitter Feed', 
    721               'post_content' => 'Our twitter feed.', 
     753              'post_title' => __('Twitter Feed' , 'tweetblender'), 
     754              'post_content' => __('Our twitter feed', 'tweetblender'), 
    722755              'post_name' => 'tweets-archive' 
    723756        ))) { 
     
    756789 
    757790    if ($item_number <= 0) { 
    758         echo("ID of the addon to install not provided... aborting"); 
     791        echo __('ID of the addon to install not provided', 'tweetblender') . '... ' . __('aborting', 'tweetblender'); 
    759792        return; 
    760793    } 
     
    764797 
    765798    // Show status updates on screen 
    766     echo "<h3>Installing $package_name for Tweet Blender</h3>\n"; 
     799    echo "<h3>" . sprintf(__('Installing %s for Tweet Blender','tweetblender'), $package_name) . "</h3>\n"; 
    767800 
    768801    // get purchase transaction id 
    769802    $txn_id = tb_get_txn_id($item_number); 
    770803    if (!isset($txn_id) || strlen($txn_id) < 10) { 
    771         echo("Can't confirm purchase... aborting\n"); 
     804        echo __('Can not confirm purchase', 'tweetblender') . '... ' . __('aborting', 'tweetblender'); 
    772805        return; 
    773806    } 
    774807 
    775808    // Download 
    776     echo "Downloading package... \n"; 
     809    echo __("Downloading package",'tweetblender') . "... \n"; 
    777810    $response = wp_remote_get('http://tweetblender.com/download.php?item_number=' . $item_number . '&blog_url=' . urlencode(get_bloginfo('url')) . '&txn_id=' . $txn_id); 
    778811     
    779812    // if couldn't download - report error 
    780813    if(is_wp_error($response)) { 
    781         echo 'not able to download. Error: ' . $response->get_error_message();; 
     814        echo __('not able to download', 'tweetblender') . '. ' . __('Error', 'tweetblender') . ': ' . $response->get_error_message(); 
    782815        return; 
    783816    } 
    784817    // else, if validation error 
    785818    elseif(isset($response['headers']['validation-error'])) { 
    786         echo 'not able to download. Error: ' . $response['headers']['validation-error']; 
     819        echo __('not able to download', 'tweetblender') . '. ' . __('Error', 'tweetblender') . ': ' . $response['headers']['validation-error']; 
    787820        return; 
    788821    } 
     
    797830        // if couldn't save - report error 
    798831        if (file_put_contents($file_name,wp_remote_retrieve_body($response)) === false) { 
    799             echo "unable to save file $file_name. Check directory permissions"; 
     832            echo sprintf(__("unable to save file %s. Check directory permissions",'tweetblender'),$file_name); 
    800833            return; 
    801834        } 
    802835        // else - proceed to unzip 
    803836        else { 
    804             echo "done<br />"; 
     837            echo __('done', 'tweetblender') . "<br />"; 
    805838     
    806839            // Unpack 
    807             echo "Unpacking... \n"; 
     840            echo __('Unpacking', 'tweetblender') . "... \n"; 
    808841            class_exists('PclZip') || include_once dirname(__FILE__) . '/pclzip.lib.php'; 
    809842            $archive = new PclZip($file_name); 
     
    811844            // if can't unzip - report error 
    812845            if (($v_result_list = $archive->extract(PCLZIP_OPT_SET_CHMOD, 0777, PCLZIP_OPT_PATH, WP_PLUGIN_DIR)) == 0) { 
    813                 echo "unable to unzip. Error: " . $archive->get_error_message(); 
    814                 rturn; 
     846                echo __('unable to unzip', 'tweetblender') . '. ' . __('Error','tweetblender') . ': ' . $archive->get_error_message(); 
     847                return; 
    815848            } 
    816849            // else - proceed to activate 
    817850            else { 
    818851 
    819                 echo "done<br />"; 
     852                echo __('done', 'tweetblender') . "<br />"; 
    820853 
    821854                // clean up by removing zip file 
     
    823856                     
    824857                // Activate 
    825                 echo "Activating... \n"; 
     858                echo __('Activating', 'tweetblender') . "... \n"; 
    826859                $activation = activate_plugin(WP_PLUGIN_DIR . '/' . $package_file_name . '/' . $package_file_name . '.php'); 
    827860                 
    828861                // if can't activate - report error 
    829862                if (is_wp_error($activation)) { 
    830                     echo "unable to activate, please try to do it manually. Error: " . $activation->get_error_message(); 
     863                    echo  __('unable to activate, please try to do it manually', 'tweetblender') . '. ' . __('Error', 'tweetblender') . ': ' . $activation->get_error_message(); 
    831864                    return; 
    832865                } 
    833866                // else - wrap it up 
    834867                else { 
    835                     echo "done<br />"; 
     868                    echo __('done', 'tweetblender') . "<br />"; 
    836869                     
    837870                    /* TODO: change permissions to the same as ours 
     
    843876                    $url = tb_get_current_page_url(); 
    844877                    $url = str_replace('&install_addon=1', '', $url); 
    845                     echo "All Done!<br /><br /><a href='$url'>Start using $package_name</a><br /><br />"; 
     878                    echo __('All Done!', 'tweetblender') . "<br /><br /><a href='$url'>" . __('Start using', 'tweetblender') . ' ' . $package_name . "</a><br /><br />"; 
    846879                } 
    847880            } 
  • tweet-blender/trunk/readme.txt

    r357092 r381114  
    11=== Tweet Blender === 
    22Contributors: kirilln 
    3 Tags: sidebar, twitter, tweets, multiple authors, favorites, tweet, tags, lists, hashtags, archive, widget, admin, AJAX, jquery, keywords, BuddyPress 
     3Tags: sidebar, twitter, tweets, multiple authors, favorites, tweet, tags, lists, hashtags, archive, widget, admin, AJAX, jquery, keywords, BuddyPress, blender 
    44Requires at least: 2.8.0 
    5 Tested up to: 3.1 
    6 Stable tag: 3.3.5 
     5Tested up to: 3.1.2 
     6Stable tag: 3.3.6 
    77Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5907095 
    88 
     
    2020 
    2121= Features = 
     22* NEW: fully localizable! Russian translation available as of 3.3.6, more languages coming soon (please get in touch if you can help) 
     23* NEW: ability to apply filtering to lists e.g. @tweetblender/testlist|plugin will pull all tweets from that list that contain word "plugin" 
    2224* NEW: ability to get Cache Manager addon ($) that allows to backup/restore cache and delete individual tweets 
    23 * NEW: if you use custom field "tb_tags" for a post its value overrides actual tags and gets used by Tweet Blender for Tags widget (requested by Thomas P via GetSatisfaction) 
    24 * NEW: support for non-English hashtags and filter words 
     25* If you use custom field "tb_tags" for a post its value overrides actual tags and gets used by Tweet Blender for Tags widget (requested by Thomas P via GetSatisfaction) 
     26* Support for non-English hashtags and filter words 
    2527* A filter that allows to filter out tweets that are from different screen names but have exactly same content 
    2628* A filter that allows to show only replies and hide original tweets 
     
    177179== Changelog == 
    178180 
     181= 3.3.6 = 
     182* New feature: ability to filter a list using pipe symbol e.g. @user/list|#hash or @user/list|keyword  
     183* Bug fix: plugin allowed to have an empty string or space under filtered keywords which filtered out all tweets and produced "No tweets found message" 
     184* Bug fix: plugin allowed to select both "hide mentions" and "hide NOT mentions" under Filters tab which produced "No tweets found message" 
     185* Improvement: all labels are now translatable. Russian translations available as of this version. Dutch coming next 
     186* Improvement: plugin now works even when extra markup is added to the form by other misbehaving plugins (thanks to doug S for reporting via GetSatisfaction) 
     187* Tested with WordPress 3.1.1 and 3.1.2 
     188 
    179189= 3.3.5 = 
    180190* Bug fix: Cache Manager not working if your blog is not in the root of your domain (thanks to Brad for reporting via GetSatisfaction) 
  • tweet-blender/trunk/tweet-blender.php

    r357092 r381114  
    22/* 
    33Plugin Name: Tweet Blender 
    4 Plugin URI: http://www.tweet-blender.com 
     4Plugin URI: http://www.tweetblender.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.5 
     6Version: 3.3.6 
    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// load localization file 
     29load_plugin_textdomain('tweetblender', false, dirname(plugin_basename(__FILE__)) . "/lang/"); 
    2730 
    2831// if on PHP5, include oAuth library and config 
     
    187190function tb_load_js() { 
    188191 
     192    global $js_labels; 
     193     
    189194    $dependencies = array('jquery');     
    190195    $tb_o = get_option('tweet-blender'); 
     
    203208    wp_enqueue_script('jsonp', '/' . PLUGINDIR . '/tweet-blender/js/jquery.jsonp-2.1.4.min.js', array('jquery')); 
    204209     
     210    // load lib 
     211    wp_enqueue_script('tb-lib', '/' . PLUGINDIR . '/tweet-blender/js/lib.js',array('jquery')); 
     212    wp_localize_script('tb-lib', 'TB_labels', $js_labels); 
     213    $dependencies[] = 'tb-lib'; 
     214     
    205215    // load main JS code 
    206     wp_enqueue_script('tbmain', '/' . PLUGINDIR . '/tweet-blender/js/main.js', $dependencies); 
     216    wp_enqueue_script('tb-main', '/' . PLUGINDIR . '/tweet-blender/js/main.js', $dependencies); 
    207217} 
    208218 
  • tweet-blender/trunk/widget-favorites.php

    r354049 r381114  
    11<?php 
    22 
    3 // version 3.3.4 
     3// version 3.3.6 
    44 
    55class TweetBlenderFavorites extends WP_Widget { 
     
    77    // constructor    
    88    function TweetBlenderFavorites() { 
    9         parent::WP_Widget('tweetblenderfavorites', 'Tweet Blender Favorites', array('description' => 'Shows favorite tweets for one or multiple @users.'));  
     9        parent::WP_Widget('tweetblenderfavorites', __('Tweet Blender Favorites', 'tweetblender'), array('description' => __('Shows favorite tweets for one or multiple @users', 'tweetblender')));   
    1010    } 
    1111  
     
    4949            }  
    5050            else { 
    51                 $view_more_text = "view more"; 
     51                $view_more_text = __("view more", 'tweetblender'); 
    5252            } 
    5353             
     
    147147                        update_option('tweet-blender',$tb_o); 
    148148                         
    149                         $errors[] = "Sources have protected screen names. <a href='javascript:tAuth(\"" . $connection->getAuthorizeURL($token) . "\")' title='Authorize Twitter Access'>Use your Twitter account to access them</a>."; 
     149                        $errors[] = __("Sources have protected screen names.", 'tweetblender') . "<a href='javascript:tAuth(\"" . $connection->getAuthorizeURL($token) . "\")' title= __('Authorize Twitter Access', 'tweetblender')> __('Use your Twitter account to access them', 'tweetblender')</a>."; 
    150150         
    151151                    } 
    152152                    else { 
    153                         $errors[] = "Sources have protected screen names but Twitter oAuth is not possible at this time. Please remove them from the list. <!--" . $connection->last_api_call . "-->"; 
     153                        $errors[] = __("Sources have protected screen names but Twitter oAuth is not possible at this time. Please remove them from the list.", 'tweetblender') .  "<!--" . $connection->last_api_call . "-->"; 
    154154                    } 
    155155                } 
    156156                else { 
    157                     $errors[] = "Sources have protected screen names but Twitter oAuth class is not available. Please remove them from the list."; 
     157                    $errors[] = __("Sources have protected screen names but Twitter oAuth class is not available. Please remove them from the list.", 'tweetblender'); 
    158158                } 
    159159            } 
     
    161161 
    162162        if (sizeof($errors) == 0 && !$have_bad_sources) { 
    163             $this->message = 'Settings saved<br/><br/>' . join(', ',$status_msg);; 
     163            $this->message = __('Settings saved', 'tweetblender') . '<br/><br/>' . join(', ',$status_msg); 
    164164            $instance['title'] = trim(strip_tags($new_instance['title'])); 
    165165            $instance['widget_refresh_rate'] = $new_instance['widget_refresh_rate']; 
     
    186186 
    187187        $default =  array(  
    188             'title' => __('Favorite Tweets'), 
     188            'title' => __('Favorite Tweets', 'tweetblender'), 
    189189            'widget_refresh_rate' => 0, 
    190190            'widget_tweets_num' => 4, 
     
    207207        $field_id = $this->get_field_id('title'); 
    208208        $field_name = $this->get_field_name('title'); 
    209         echo "\r\n".'<p><label for="'.$field_id.'">'.__('Title').': <input type="text" class="widefat" id="'.$field_id.'" name="'.$field_name.'" value="'.esc_attr( $instance['title'] ).'" /></label></p>'; 
     209        echo "\r\n".'<p><label for="'.$field_id.'">'.__('Title', 'tweetblender').': <input type="text" class="widefat" id="'.$field_id.'" name="'.$field_name.'" value="'.esc_attr( $instance['title'] ).'" /></label></p>'; 
    210210 
    211211        // sources 
    212212        $field_id = $this->get_field_id('widget_sources'); 
    213213        $field_name = $this->get_field_name('widget_sources'); 
    214         echo "\r\n".'<p><label for="'.$field_id.'">'.__('Sources (one per line)').': <textarea class="widefat" id="'.$field_id.'" name="'.$field_name.'" rows=4 cols=20 wrap="hard">' . esc_attr( $instance['widget_sources'] ) . '</textarea></label></p>'; 
     214        echo "\r\n".'<p><label for="'.$field_id.'">'.__('Sources (one per line)', 'tweetblender').': <textarea class="widefat" id="'.$field_id.'" name="'.$field_name.'" rows=4 cols=20 wrap="hard">' . esc_attr( $instance['widget_sources'] ) . '</textarea></label></p>'; 
    215215 
    216216        // private sources 
     
    225225        $field_id = $this->get_field_id('widget_refresh_rate'); 
    226226        $field_name = $this->get_field_name('widget_refresh_rate'); 
    227         echo "\r\n".'<label for="'.$field_id.'">'.__('Refresh').'</label>'; 
     227        echo "\r\n".'<label for="'.$field_id.'">'.__('Refresh', 'tweetblender').'</label>'; 
    228228        echo "\r\n".'<select id="'.$field_id.'" name="'.$field_name.'">'; 
    229229             
     
    240240        $field_id = $this->get_field_id('widget_tweets_num'); 
    241241        $field_name = $this->get_field_name('widget_tweets_num'); 
    242         echo "\r\n".'<br/><label for="'.$field_id.'">'.__('Show').' <select id="'.$field_id.'" name="'.$field_name.'">'; 
     242        echo "\r\n".'<br/><label for="'.$field_id.'">'.__('Show', 'tweetblender').' <select id="'.$field_id.'" name="'.$field_name.'">'; 
    243243        for ($i = 1; $i <= 15; $i++) { 
    244244            echo "\r\n".'<option value="' . $i . '"'; 
     
    255255            echo '>' . $i . '</option>'; 
    256256        } 
    257         echo "\r\n".'</select> tweets</label><br>'; 
     257        echo "\r\n".'</select>' .__('tweets', 'tweetblender') . '</label><br>'; 
    258258 
    259259        // specify text for "view more" link 
     
    263263            $instance['widget_view_more_text'] = ''; 
    264264        }  
    265         echo "\r\n".'<br/><label for="'.$field_id.'">'.__('Text for &quot;view more&quot; link').':</label>'; 
    266         echo "\r\n".'<input class="widefat" type="text" id="'.$field_id.'" name="'.$field_name.'" value="' . esc_attr( $instance['widget_view_more_text'] ) . '">';; 
     265        echo "\r\n".'<br/><label for="'.$field_id.'">'. sprintf(__('Text for %s link', 'tweetblender'),'&quot;' . __('view more','tweetblender') . '&quot') . ':</label>'; 
     266        echo "\r\n".'<input class="widefat" type="text" id="'.$field_id.'" name="'.$field_name.'" value="' . esc_attr( $instance['widget_view_more_text'] ) . '">'; 
    267267                 
    268268        // specify URL for "view more" link 
     
    272272            $instance['widget_view_more_url'] = ''; 
    273273        }  
    274         echo "\r\n".'<br/><label for="'.$field_id.'">'.__('URL for &quot;view more&quot; link').':</label>'; 
     274        echo "\r\n".'<br/><label for="'.$field_id.'">' . sprintf(__('URL for %s link', 'tweetblender'),'&quot;' . __('view more','tweetblender') . '&quot') . ':</label>'; 
    275275        echo "\r\n".'<input class="widefat" type="text" id="'.$field_id.'" name="'.$field_name.'" value="' . esc_attr( $instance['widget_view_more_url'] ) . '"><br/>'; 
    276276        if ($archive_post = tb_get_archive_post_id()) { 
    277             echo '<span style="color:#777;font-style:italic;">Leave blank to use <a href="page.php?action=edit&post=' . $archive_post . '" target="_blank">existing page</a></span>'; 
     277            echo '<span style="color:#777;font-style:italic;">' . __('Leave blank to use ', 'tweetblender') . '<a href="page.php?action=edit&post=' . $archive_post . '" target="_blank">' . __('existing page', 'tweetblender') . '</a></span>'; 
    278278        } 
    279279    } 
     
    306306        // remove modifiers 
    307307        if (stripos($src,'|') > 1) { 
    308             $source_check_result = ' ' . $src . ' - <span class="fail">FAIL</span>'; 
    309             $log_msg = "($src) only screen names work with favorites\n"; 
     308            $source_check_result = ' ' . $src . ' - <span class="fail">' . __('FAIL', 'tweetblender') . '</span>'; 
     309            $log_msg = "($src)" . __('only screen names work with favorites', 'tweetblender') ."\n"; 
    310310            return array($is_ok,$is_private,$need_oauth,$source_check_result,$log_msg); 
    311311        } 
     
    314314        // if it's a list, report it as bad source 
    315315        if (stripos($src,'@') === 0 && stripos($src,'/') > 1) { 
    316             $source_check_result = ' ' . $src . ' - <span class="fail">FAIL</span>'; 
    317             $log_msg = "($src) only screen names work with favorites\n"; 
     316            $source_check_result = ' ' . $src . ' - <span class="fail">' . __('FAIL', 'tweetblender') . '</span>'; 
     317            $log_msg = "($src)" . __('only screen names work with favorites', 'tweetblender') ."\n"; 
    318318            return array($is_ok,$is_private,$need_oauth,$source_check_result,$log_msg); 
    319319        } 
     
    325325        // else assume it's a hashtag or keyword, report as bad source 
    326326        else { 
    327             $source_check_result = ' ' . $src . ' - <span class="fail">FAIL</span>'; 
    328             $log_msg = "($src) only screen names work with favorites\n"; 
     327            $source_check_result = ' ' . $src . ' - <span class="fail">' . __('FAIL', 'tweetblender') . '</span>'; 
     328            $log_msg = "($src)" . __('only screen names work with favorites',  'tweetblender') ."\n"; 
    329329            return array($is_ok,$is_private,$need_oauth,$source_check_result,$log_msg); 
    330330        } 
     
    341341            // if Twitter reported error 
    342342            if (!isset($jsonData)) { 
    343                 $source_check_result = ' ' . $src . ' - <span class="fail">FAIL</span>'; 
    344                 $log_msg = "($src) json error: could not decode body\n"; 
     343                $source_check_result = ' ' . $src . ' - <span class="fail">' . __('FAIL', 'tweetblender') . '</span>'; 
     344                $log_msg = "($src)" . __('json error','tweetblender') . ': ' . __('could not decode body',  'tweetblender') ."\n"; 
    345345            } 
    346346            elseif(isset($jsonData->{'error'})) { 
     
    351351                    // if we don't have access tokens - error 
    352352                    if (!array_key_exists('oauth_access_token',$tb_o)) { 
    353                         $source_check_result = $src . ' - <span class="fail">PRIVATE</span>'; 
    354                         $log_msg = "($src) Private: needs oAuth\n"; 
     353                        $source_check_result = $src . ' - <span class="fail">' . __('PRIVATE', 'tweetblender') . '</span>'; 
     354                        $log_msg = "($src)" . __('Private: needs oAuth',  'tweetblender') ."\n"; 
    355355                        $need_oauth = true; 
    356356                    } 
     
    358358                    else { 
    359359                        $is_ok = true; 
    360                         $source_check_result = ' ' . $src . ' - <span class="pass">PRIVATE</span>'; 
    361                         $log_msg = "($src) Private: we have oAuth\n"; 
     360                        $source_check_result = ' ' . $src . ' - <span class="pass">' . __('PRIVATE', 'tweetblender') . '</span>'; 
     361                        $log_msg = "($src)" . __('Private: we have oAuth', 'tweetblender') ."\n"; 
    362362                    } 
    363363                } 
     
    365365                elseif (strpos($jsonData->{error},"Rate limit exceeded") === 0) { 
    366366                    $is_ok = true; 
    367                     $source_check_result = ' ' . $src . ' - <span class="pass">OK</span>'; 
    368                     $log_msg = "($src) Error: limit error\n"; 
     367                    $source_check_result = ' ' . $src . ' - <span class="pass">' . __('OK', 'tweetblender') . '</span>'; 
     368                    $log_msg = "($src)" . __('Error','tweetblender') . ': ' . __('limit error', 'tweetblender') ."\n"; 
    369369                } 
    370370                // any other error is an error 
    371371                else { 
    372                     $source_check_result = ' ' . $src . ' - <span class="fail">FAIL</span>'; 
    373                     $log_msg = "($src) json error: " . $jsonData->{error} . "\n"; 
     372                    $source_check_result = ' ' . $src . ' - <span class="fail">' . __('FAIL', 'tweetblender') . '</span>'; 
     373                    $log_msg = "($src)" . __('json error','tweetblender') . ': ' . $jsonData->{error} . "\n"; 
    374374                } 
    375375            } 
     
    377377            else { 
    378378                $is_ok = true; 
    379                 $source_check_result = ' ' . $src . ' - <span class="pass">OK</span>'; 
    380                 $log_msg = "($src) Got json with no errors\n"; 
     379                $source_check_result = ' ' . $src . ' - <span class="pass">' . __('OK', 'tweetblender') . '</span>'; 
     380                $log_msg = "($src)" . __('Got json with no errors',  'tweetblender') . "\n"; 
    381381            } 
    382382        } 
     
    402402                else { 
    403403                    $need_oauth = true; 
    404                     $source_check_result = ' ' . $src . ' - <span class="fail">PRIVATE</span>'; 
    405                     $log_msg = "($src) Private: needs oAuth\n"; 
     404                    $source_check_result = ' ' . $src . ' - <span class="fail">' . __('PRIVATE', 'tweetblender') . '</span>'; 
     405                    $log_msg = "($src)" . __('Private: needs oAuth',  'tweetblender') . "\n"; 
    406406                } 
    407407            } 
    408408            // else it's a bad source 
    409409            else { 
    410                 $source_check_result = ' ' . $src . ':<span class="fail">FAIL</span>'; 
    411                 $log_msg = "($src) HTTP error: " . $result->get_error_message() . "\n"; 
     410                $source_check_result = ' ' . $src . ':<span class="fail">' . __('FAIL', 'tweetblender') . '</span>'; 
     411                $log_msg = "($src)" . __('HTTP error:  ',  'tweetblender') . $result->get_error_message() . "\n"; 
    412412            } 
    413413        } 
  • tweet-blender/trunk/widget-tags.php

    r354049 r381114  
    77    // constructor    
    88    function TweetBlenderForTags() { 
    9         parent::WP_Widget('tweetblenderfortags', 'Tweet Blender For Tags', array('description' => 'Shows related tweets by searching Twitter using tags of your post as keywords.'));    
     9        parent::WP_Widget('tweetblenderfortags', __('Tweet Blender For Tags', 'tweetblender'), array('description' => __('Shows related tweets by searching Twitter using tags of your post as keywords.', 'tweetblender'))); 
    1010    } 
    1111  
     
    1717        // don't show widget if we are not on a post page 
    1818        if ($post == null || $post->post_type != 'post') { 
    19             echo '<!-- Tweet Blender: Not shown as this is not a post -->'; 
     19            echo '<!-- ' . __('Tweet Blender: Not shown as this is not a post', 'tweetblender') . ' -->'; 
    2020            return; 
    2121        } 
     
    3838        // don't show widget if there are no tags 
    3939        else { 
    40             echo '<!-- Tweet Blender: Not shown as there are no tags for this post -->'; 
     40            echo '<!-- ' . __('Tweet Blender: Not shown as there are no tags for this post', 'tweetblender') . ' -->'; 
    4141            return; 
    4242        } 
     
    7878        $instance['widget_tweets_num'] = $new_instance['widget_tweets_num']; 
    7979 
    80         $this->message = 'Settings saved'; 
     80        $this->message = __('Settings saved', 'tweetblender'); 
    8181        return $instance; 
    8282    } 
     
    8787 
    8888        $default =  array(  
    89             'title' => __('Tweet Blender'), 
     89            'title' => __('Tweet Blender', 'tweetblender'), 
    9090            'widget_refresh_rate' => 0, 
    9191            'widget_tweets_num' => 4 
     
    101101        $field_id = $this->get_field_id('title'); 
    102102        $field_name = $this->get_field_name('title'); 
    103         echo "\r\n".'<p><label for="'.$field_id.'">'.__('Title').': <input type="text" class="widefat" id="'.$field_id.'" name="'.$field_name.'" value="'.esc_attr( $instance['title'] ).'" /></label></p>'; 
     103        echo "\r\n".'<p><label for="'.$field_id.'">'.__('Title', 'tweetblender').': <input type="text" class="widefat" id="'.$field_id.'" name="'.$field_name.'" value="'.esc_attr( $instance['title'] ).'" /></label></p>'; 
    104104 
    105105        // specify refresh 
    106106        $field_id = $this->get_field_id('widget_refresh_rate'); 
    107107        $field_name = $this->get_field_name('widget_refresh_rate'); 
    108         echo "\r\n".'<label for="'.$field_id.'">'.__('Refresh').'</label>'; 
     108        echo "\r\n".'<label for="'.$field_id.'">'.__('Refresh', 'tweetblender').'</label>'; 
    109109        echo "\r\n".'<select id="'.$field_id.'" name="'.$field_name.'">'; 
    110110             
     
    121121        $field_id = $this->get_field_id('widget_tweets_num'); 
    122122        $field_name = $this->get_field_name('widget_tweets_num'); 
    123         echo "\r\n".'<br/><label for="'.$field_id.'">'.__('Show').' <select id="'.$field_id.'" name="'.$field_name.'">'; 
     123        echo "\r\n".'<br/><label for="'.$field_id.'">' . __('Show', 'tweetblender') . ' <select id="'.$field_id.'" name="'.$field_name.'">'; 
    124124        for ($i = 1; $i <= 15; $i++) { 
    125125            echo "\r\n".'<option value="' . $i . '"'; 
     
    136136            echo '>' . $i . '</option>'; 
    137137        } 
    138         echo "\r\n".'</select> tweets</label><br>'; 
     138        echo "\r\n".'</select>' . __('tweets', 'tweetblender') . '</label><br>'; 
    139139    } 
    140140} 
  • tweet-blender/trunk/widget.php

    r354049 r381114  
    11<?php 
    22 
    3 // version 3.3.4 
     3// version 3.3.6 
    44 
    55class TweetBlender extends WP_Widget { 
     
    77    // constructor    
    88    function TweetBlender() { 
    9         parent::WP_Widget('tweetblender', 'Tweet Blender', array('description' => 'Shows tweets for @users, @user/lists, #hashtags, and keywords blended together.'));   
     9        parent::WP_Widget('tweetblender', __('Tweet Blender', 'tweetb'), array('description' => __('Shows tweets for @users, @user/lists, #hashtags, and keywords blended together', 'tweetblender')));  
    1010    } 
    1111  
     
    4949            }  
    5050            else { 
    51                 $view_more_text = "view more"; 
     51                $view_more_text = __("view more", 'tweetblender'); 
    5252            } 
    5353             
     
    163163                        update_option('tweet-blender',$tb_o); 
    164164                         
    165                         $errors[] = "Sources have protected screen names. <a href='javascript:tAuth(\"" . $connection->getAuthorizeURL($token) . "\")' title='Authorize Twitter Access'>Use your Twitter account to access them</a>."; 
     165                        $errors[] = __("Sources have protected screen names.", 'tweetblender') . " <a href='javascript:tAuth(\"" . $connection->getAuthorizeURL($token) . "\")' title=" . __('Authorize Twitter Access', 'tweetblender') . ">" . __('Use your Twitter account to access them', 'tweetblender') . "</a>."; 
    166166         
    167167                    } 
    168168                    else { 
    169                         $errors[] = "Sources have protected screen names but Twitter oAuth is not possible at this time. Please remove them from the list. <!--" . $connection->last_api_call . "-->"; 
     169                        $errors[] = __("Sources have protected screen names but Twitter oAuth is not possible at this time. Please remove them from the list.", 'tweetblender') .  "<!--" . $connection->last_api_call . "-->"; 
    170170                    } 
    171171                } 
    172172                else { 
    173                     $errors[] = "Sources have protected screen names but Twitter oAuth class is not available. Please remove them from the list."; 
     173                    $errors[] = __("Sources have protected screen names but Twitter oAuth class is not available. Please remove them from the list.", 'tweetblender'); 
    174174                } 
    175175            } 
     
    177177 
    178178        if (sizeof($errors) == 0 && !$have_bad_sources) { 
    179             $this->message = 'Settings saved<br/><br/>' . join(', ',$status_msg);; 
     179            $this->message = __('Settings saved', 'tweetblender') . '<br/><br/>' . join(', ',$status_msg); 
    180180            $instance['title'] = trim(strip_tags($new_instance['title'])); 
    181181            $instance['widget_refresh_rate'] = $new_instance['widget_refresh_rate']; 
     
    202202 
    203203        $default =  array(  
    204             'title' => __('Tweet Blender'), 
     204            'title' => __('Tweet Blender', 'tweetblender'), 
    205205            'widget_refresh_rate' => 0, 
    206206            'widget_tweets_num' => 4, 
     
    223223        $field_id = $this->get_field_id('title'); 
    224224        $field_name = $this->get_field_name('title'); 
    225         echo "\r\n".'<p><label for="'.$field_id.'">'.__('Title').': <input type="text" class="widefat" id="'.$field_id.'" name="'.$field_name.'" value="'.esc_attr( $instance['title'] ).'" /></label></p>'; 
     225        echo "\r\n".'<p><label for="'.$field_id.'">'.__('Title', 'tweetblender').': <input type="text" class="widefat" id="'.$field_id.'" name="'.$field_name.'" value="'.esc_attr( $instance['title'] ).'" /></label></p>'; 
    226226 
    227227        // sources 
    228228        $field_id = $this->get_field_id('widget_sources'); 
    229229        $field_name = $this->get_field_name('widget_sources'); 
    230         echo "\r\n".'<p><label for="'.$field_id.'">'.__('Sources (one per line)').': <textarea class="widefat" id="'.$field_id.'" name="'.$field_name.'" rows=4 cols=20 wrap="hard">' . esc_attr( $instance['widget_sources'] ) . '</textarea></label></p>'; 
     230        echo "\r\n".'<p><label for="'.$field_id.'">'.__('Sources (one per line)', 'tweetblender') .': <textarea class="widefat" id="'.$field_id.'" name="'.$field_name.'" rows=4 cols=20 wrap="hard">' . esc_attr( $instance['widget_sources'] ) . '</textarea></label></p>'; 
    231231 
    232232        // private sources 
     
    241241        $field_id = $this->get_field_id('widget_refresh_rate'); 
    242242        $field_name = $this->get_field_name('widget_refresh_rate'); 
    243         echo "\r\n".'<label for="'.$field_id.'">'.__('Refresh').'</label>'; 
     243        echo "\r\n".'<label for="'.$field_id.'">'.__('Refresh', 'tweetblender').'</label>'; 
    244244        echo "\r\n".'<select id="'.$field_id.'" name="'.$field_name.'">'; 
    245245             
     
    256256        $field_id = $this->get_field_id('widget_tweets_num'); 
    257257        $field_name = $this->get_field_name('widget_tweets_num'); 
    258         echo "\r\n".'<br/><label for="'.$field_id.'">'.__('Show').' <select id="'.$field_id.'" name="'.$field_name.'">'; 
     258        echo "\r\n".'<br/><label for="'.$field_id.'">' . __('Show', 'tweetblender') . ' <select id="'.$field_id.'" name="'.$field_name.'">'; 
    259259        for ($i = 1; $i <= 15; $i++) { 
    260260            echo "\r\n".'<option value="' . $i . '"'; 
     
    271271            echo '>' . $i . '</option>'; 
    272272        } 
    273         echo "\r\n".'</select> tweets</label><br>'; 
     273        echo "\r\n</select>" . __('tweets','tweetblender') . '</label><br>'; 
    274274 
    275275        // specify text for "view more" link 
     
    279279            $instance['widget_view_more_text'] = ''; 
    280280        }  
    281         echo "\r\n".'<br/><label for="'.$field_id.'">'.__('Text for &quot;view more&quot; link').':</label>'; 
    282         echo "\r\n".'<input class="widefat" type="text" id="'.$field_id.'" name="'.$field_name.'" value="' . esc_attr( $instance['widget_view_more_text'] ) . '">';; 
     281        echo "\r\n".'<br/><label for="'.$field_id.'">'. sprintf(__('Text for %s link', 'tweetblender'),'&quot;' . __('view more','tweetblender') . '&quot') . ':</label>'; 
     282        echo "\r\n".'<input class="widefat" type="text" id="'.$field_id.'" name="'.$field_name.'" value="' . esc_attr( $instance['widget_view_more_text'] ) . '">'; 
    283283         
    284284        // specify URL for "view more" link 
     
    288288            $instance['widget_view_more_url'] = ''; 
    289289        }  
    290         echo "\r\n".'<br/><label for="'.$field_id.'">'.__('URL for &quot;view more&quot; link').':</label>'; 
     290        echo "\r\n".'<br/><label for="'.$field_id.'">' . sprintf(__('URL for %s link', 'tweetblender'),'&quot;' . __('view more','tweetblender') . '&quot') . ':</label>'; 
    291291        echo "\r\n".'<input class="widefat" type="text" id="'.$field_id.'" name="'.$field_name.'" value="' . esc_attr( $instance['widget_view_more_url'] ) . '"><br/>'; 
    292292        if ($archive_post = tb_get_archive_post_id()) { 
    293             echo '<span style="color:#777;font-style:italic;">Leave blank to use <a href="page.php?action=edit&post=' . $archive_post . '" target="_blank">existing page</a></span>'; 
     293            echo '<span style="color:#777;font-style:italic;">' . __('Leave blank to use ', 'tweetblender') . '<a href="page.php?action=edit&post=' . $archive_post . '" target="_blank">' . __('existing page', 'tweetblender') . '</a></span>'; 
    294294        } 
    295295 
     
    353353            $jsonData = $wp_json->decode($result['body']); 
    354354            if (!isset($jsonData)) { 
    355                 $source_check_result = ' ' . $src . ' - <span class="fail">FAIL</span>'; 
    356                 $log_msg = "($src) json error: can't get json\n" . $apiUrl; 
     355                $source_check_result = ' ' . $src . ' - <span class="fail">' . __('FAIL', 'tweetblender') . '</span>'; 
     356                $log_msg = "($src) " . __('json error','tweetblender') . ': ' . __('can not get json', 'tweetblender') . "\n" . $apiUrl; 
    357357            } 
    358358            // if Twitter reported error 
     
    363363                    // if we don't have access tokens - error 
    364364                    if (!array_key_exists('oauth_access_token',$tb_o)) { 
    365                         $source_check_result = $src . ' - <span class="fail">PRIVATE</span>'; 
    366                         $log_msg = "($src) Private: needs oAuth\n"; 
     365                        $source_check_result = $src . ' - <span class="fail">' . __('PRIVATE', 'tweetblender') . '</span>'; 
     366                        $log_msg = "($src) " . __('Private: needs oAuth',  'tweetblender') . "\n"; 
    367367                        $need_oauth = true; 
    368368                    } 
     
    370370                    else { 
    371371                        $is_ok = true; 
    372                         $source_check_result = ' ' . $src . ' - <span class="pass">PRIVATE</span>'; 
    373                         $log_msg = "($src) Private: we have oAuth\n"; 
     372                        $source_check_result = ' ' . $src . ' - <span class="pass">' . __('PRIVATE', 'tweetblender') . '</span>'; 
     373                        $log_msg = "($src) " . __('Private: we have oAuth', 'tweetblender') . "\n"; 
    374374                    } 
    375375                } 
     
    377377                elseif (strpos($jsonData->{error},"Rate limit exceeded") === 0) { 
    378378                    $is_ok = true; 
    379                     $source_check_result = ' ' . $src . ' - <span class="pass">OK</span>'; 
    380                     $log_msg = "($src) Error: limit error\n"; 
     379                    $source_check_result = ' ' . $src . ' - <span class="pass">' . __('OK', 'tweetblender') . '</span>'; 
     380                    $log_msg = "($src) " . __('Error','tweetblender') . ': ' . __('limit error', 'tweetblender') . "\n"; 
    381381                } 
    382382                // any other error is an error 
    383383                else { 
    384                     $source_check_result = ' ' . $src . ' - <span class="fail">FAIL</span>'; 
    385                     $log_msg = "($src) json error: " . $jsonData->{error} . "\n"; 
     384                    $source_check_result = ' ' . $src . ' - <span class="fail">' . __('FAIL', 'tweetblender') . '</span>'; 
     385                    $log_msg = "($src) " . __('json error','tweetblender') . ': ' . $jsonData->{error} . "\n"; 
    386386                } 
    387387            } 
     
    389389            else { 
    390390                $is_ok = true; 
    391                 $source_check_result = ' ' . $src . ' - <span class="pass">OK</span>'; 
    392                 $log_msg = "($src) Got json with no errors\n"; 
     391                $source_check_result = ' ' . $src . ' - <span class="pass">' . __('OK', 'tweetblender') . '</span>'; 
     392                $log_msg = "($src) " . __('Got json with no errors', 'tweetblender') . "\n"; 
    393393            } 
    394394        } 
     
    414414                else { 
    415415                    $need_oauth = true; 
    416                     $source_check_result = ' ' . $src . ' - <span class="fail">PRIVATE</span>'; 
    417                     $log_msg = "($src) Private: needs oAuth\n"; 
     416                    $source_check_result = ' ' . $src . ' - <span class="fail">' . __('PRIVATE', 'tweetblender') . '</span>'; 
     417                    $log_msg = "($src)" . __('Private: needs oAuth', 'tweetblender') . "\n"; 
    418418                } 
    419419            } 
    420420            // else it's a bad source 
    421421            else { 
    422                 $source_check_result = ' ' . $src . ':<span class="fail">FAIL</span>'; 
    423                 $log_msg = "($src) HTTP error: " . $result->get_error_message() . "\n"; 
     422                $source_check_result = ' ' . $src . ':<span class="fail">' . __('FAIL', 'tweetblender') . '</span>'; 
     423                $log_msg = "($src)" . __('HTTP error:  ',  'tweetblender') . $result->get_error_message() . "\n"; 
    424424            } 
    425425        } 
  • tweet-blender/trunk/ws.php

    r354049 r381114  
    11<?php 
    22 
    3 // version 3.3.4 
     3// version 3.3.6 
    44 
    55// include WP functions 
     
    7979        // check to make sure we have the class 
    8080        if (!class_exists('TwitterOAuth')) { 
    81             echo $wp_json->encode(array('error' => 'Twitter oAuth is not available')); 
     81            echo $wp_json->encode(array('error' => __('Twitter oAuth is not available', 'tweetb'))); 
    8282            exit; 
    8383        } 
     
    8585        // make sure we have oAuth info 
    8686        if (!isset($tb_o['oauth_access_token'])){ 
    87             echo $wp_json->encode(array('error' => "Don't have oAuth login info")); 
     87            echo $wp_json->encode(array('error' => __("Do not have oAuth login info", 'tweetb'))); 
    8888            exit; 
    8989        } 
     
    102102                } 
    103103                else { 
    104                     echo $json->encode(array('error' => ' No cache. Connection status code ' . $oAuth->http_code)); 
     104                    echo $json->encode(array('error' => __('No cache. Connection status code', 'tweetb') . ' ' . $oAuth->http_code)); 
    105105                } 
    106106                exit; 
     
    134134                // else, report error 
    135135                else { 
    136                     echo $json->encode(array('error' => 'No cache. Connection status code ' . $result['response']['code'] . " " . $result->response['message'])); 
     136                    echo $json->encode(array('error' => __('No cache. Connection status code', 'tweetb') . ' ' . $result['response']['code'] . " " . $result->response['message'])); 
    137137                } 
    138138                exit; 
     
    154154    } 
    155155    else { 
    156         echo $wp_json->encode(array('error' => "Can't retrieve limit info from Twitter")); 
     156        echo $wp_json->encode(array('error' => __("Can't retrieve limit info from Twitter", 'tweetb'))); 
    157157        exit; 
    158158    } 
     
    166166        $referer = parse_url(esc_attr($_SERVER['HTTP_REFERER'])); 
    167167        if ($referer['host'] != esc_attr($_SERVER['SERVER_NAME']) && $referer['host'] != 'www.' . esc_attr($_SERVER['SERVER_NAME'])) { 
    168             echo $wp_json->encode(array('error' => "Request from unauthorized page. \n" . esc_attr($_SERVER['SERVER_NAME']) . "\n" . $referer['host'])); 
     168            echo $wp_json->encode(array('error' => __('Request from unauthorized page', 'tweetblender') . ".\n" . esc_attr($_SERVER['SERVER_NAME']) . "\n" . $referer['host'])); 
    169169            exit; 
    170170        } 
     
    182182        } 
    183183        else { 
    184             echo $wp_json->encode(array('error' => 'Cannot store tweets to DB')); 
     184            echo $wp_json->encode(array('error' => __('Cannot store tweets to DB', 'tweetblender'))); 
    185185        } 
    186186        exit; 
    187187    } 
    188188    else { 
    189         echo $wp_json->encode(array('error' => 'Invalid data format')); 
     189        echo $wp_json->encode(array('error' => __('Invalid data format', 'tweetblender'))); 
    190190        exit; 
    191191    }        
Note: See TracChangeset for help on using the changeset viewer.