Plugin Directory

Changeset 925774


Ignore:
Timestamp:
06/03/2014 04:26:38 PM (12 years ago)
Author:
kjbenk
Message:

Fixes bug with internationalization

Location:
gabfire-widget-pack/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • gabfire-widget-pack/trunk/admin/options.php

    r848737 r925774  
    105105    ?>
    106106    <script type="text/javascript">
    107         $(document).ready(function() {     
    108             $('#textbox1').val($(this).is(':checked'));
    109            
     107        jQuery(document).ready(function($) {
     108
     109            //Change widget status
     110
     111            $(".gabfire_checkbox").change(function() {
     112
     113                if ($(this).is(":checked")) {
     114                    $("." + $(this).attr("id")).removeClass("deactive").addClass("active");
     115                } else {
     116                    $("." + $(this).attr("id")).removeClass("active").addClass("deactive");
     117                }
     118
     119            });
     120
     121            /*
     122$('#textbox1').val($(this).is(':checked'));
     123
    110124            $('#checkbox1').change(function() {
    111125                $('.mycheck').val($(this).is(':checked'));
    112126            });
    113         });
     127*/
     128        });
    114129    </script>
    115    
    116    
    117    
    118130<div class="wrap gabfire-plugin-settings">
    119    
     131
    120132    <div id="panelheader">
    121133        <div id="branding">
     
    127139            Gabfire Widget Pack
    128140        </div>
    129     </div> 
    130    
     141    </div>
     142
    131143    <div class="metabox-holder has-right-sidebar ">
    132144        <div class="inner-sidebar">
     
    142154                </div>
    143155            </div>
    144            
     156
    145157            <div class="postbox">
    146158                <h3><span>Social</span></h3>
     
    154166                    </ul>
    155167                </div>
    156             </div>         
     168            </div>
    157169
    158170            <div class="postbox">
     
    178190                            <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'gabfire-widget-pack') ?>" />
    179191                        </div>
    180                        
     192
    181193                        <div class="inside">
    182                    
     194
    183195                            <?php settings_fields('gab_plugin_options'); ?>
    184196                            <?php $options = get_option('gab_options'); ?>
    185197                            <p class="activate_widgets_notice"></p>
    186                            
     198
    187199                            <div class="gabfire-col-left">
    188                
     200
    189201                                <?php if(isset($options['about_widget']) && $options['about_widget'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    190                                 <div class="gab_option_box <?php echo $state; ?>">
     202                                <div class="gab_options_about_widget gab_option_box <?php echo $state; ?>">
    191203                                    <div class="gab_option_box_inner">
    192204                                        <h3><?php _e('About Us','gabfire-widget-pack'); ?></h3>
    193205                                        <label class="widget_trigger">
    194                                             <input  type="checkbox" name="gab_options[about_widget]" value="1" <?php if (isset($options['about_widget'])) { checked('1', $options['about_widget']); } ?> />
     206                                            <input type="checkbox" class="gabfire_checkbox" id="gab_options_about_widget" name="gab_options[about_widget]" value="1" <?php if (isset($options['about_widget'])) { checked('1', $options['about_widget']); } ?> />
    195207                                            <span class="gab_switcher">
    196208                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    202214                                    </div><!-- .gab_option_box_inner -->
    203215                                </div>
    204                                
     216
    205217                                <?php if(isset($options['ajaxtabs']) && $options['ajaxtabs'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    206                                 <div class="gab_option_box <?php echo $state; ?>">
     218                                <div class="gab_options_ajaxtabs gab_option_box <?php echo $state; ?>">
    207219                                    <div class="gab_option_box_inner">
    208220                                        <h3><?php _e('Posts Tabs Widget','gabfire-widget-pack'); ?></h3>
    209                                        
    210                                         <label class="widget_trigger">
    211                                             <input  type="checkbox" name="gab_options[ajaxtabs]" value="1" <?php if (isset($options['ajaxtabs'])) { checked('1', $options['ajaxtabs']); } ?> />
     221
     222                                        <label class="widget_trigger">
     223                                            <input type="checkbox" class="gabfire_checkbox" id="gab_options_ajaxtabs" name="gab_options[ajaxtabs]" value="1" <?php if (isset($options['ajaxtabs'])) { checked('1', $options['ajaxtabs']); } ?> />
    212224                                            <span class="gab_switcher">
    213225                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    219231                                    </div><!-- .gab_option_box_inner -->
    220232                                </div>
    221                                                                
     233
    222234                                <?php if(isset($options['authorbadge']) && $options['authorbadge'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    223                                 <div class="gab_option_box <?php echo $state; ?>">
     235                                <div class="gab_options_authorbadge gab_option_box <?php echo $state; ?>">
    224236                                    <div class="gab_option_box_inner">
    225237                                        <h3><?php _e('Author Badge','gabfire-widget-pack'); ?></h3>
    226                                        
    227                                         <label class="widget_trigger">
    228                                             <input  type="checkbox" name="gab_options[authorbadge]" value="1" <?php if (isset($options['authorbadge'])) { checked('1', $options['authorbadge']); } ?> />
     238
     239                                        <label class="widget_trigger">
     240                                            <input type="checkbox" class="gabfire_checkbox" id="gab_options_authorbadge" name="gab_options[authorbadge]" value="1" <?php if (isset($options['authorbadge'])) { checked('1', $options['authorbadge']); } ?> />
    229241                                            <span class="gab_switcher">
    230242                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    236248                                    </div><!-- .gab_option_box_inner -->
    237249                                </div>
    238                            
     250
    239251                                <?php if(isset($options['social']) && $options['social'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    240                                 <div class="gab_option_box <?php echo $state; ?>">
     252                                <div class="gab_options_social gab_option_box <?php echo $state; ?>">
    241253                                    <div class="gab_option_box_inner">
    242254                                        <h3><?php _e('Social Icons','gabfire-widget-pack'); ?></h3>
    243                                        
    244                                         <label class="widget_trigger">
    245                                             <input  type="checkbox" name="gab_options[social]" value="1" <?php if (isset($options['social'])) { checked('1', $options['social']); } ?> />
     255
     256                                        <label class="widget_trigger">
     257                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_social" name="gab_options[social]" value="1" <?php if (isset($options['social'])) { checked('1', $options['social']); } ?> />
    246258                                            <span class="gab_switcher">
    247259                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    252264                                        <p><?php _e('Get connected with your visitors and let them know where they could find you on social platforms','gabfire-widget-pack'); ?></p>
    253265                                    </div><!-- .gab_option_box_inner -->
    254                                 </div>             
    255                            
     266                                </div>
     267
    256268                                <?php if(isset($options['feedburner']) && $options['feedburner'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    257                                 <div class="gab_option_box <?php echo $state; ?>">
     269                                <div class="gab_options_feedburner gab_option_box <?php echo $state; ?>">
    258270                                    <div class="gab_option_box_inner">
    259271                                        <h3><?php _e('Feedburner Email Subscribe','gabfire-widget-pack'); ?></h3>
    260                                        
    261                                         <label class="widget_trigger">
    262                                             <input  type="checkbox" name="gab_options[feedburner]" value="1" <?php if (isset($options['feedburner'])) { checked('1', $options['feedburner']); } ?> />
     272
     273                                        <label class="widget_trigger">
     274                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_feedburner" name="gab_options[feedburner]" value="1" <?php if (isset($options['feedburner'])) { checked('1', $options['feedburner']); } ?> />
    263275                                            <span class="gab_switcher">
    264276                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    269281                                        <p><?php _e('Display an input field where your visitors could easily signup to Feedburner Email subscription list.','gabfire-widget-pack'); ?></p>
    270282                                    </div><!-- .gab_option_box_inner -->
    271                                 </div> 
    272                            
     283                                </div>
     284
    273285                                <?php if(isset($options['popular_random']) && $options['popular_random'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    274                                 <div class="gab_option_box <?php echo $state; ?>">
    275                                     <div class="gab_option_box_inner">             
     286                                <div class="gab_options_popular_random gab_option_box <?php echo $state; ?>">
     287                                    <div class="gab_option_box_inner">
    276288                                        <h3><?php _e('Popular/Random Entries','gabfire-widget-pack'); ?></h3>
    277                                        
    278                                         <label class="widget_trigger">
    279                                             <input  type="checkbox" name="gab_options[popular_random]" value="1" <?php if (isset($options['popular_random'])) { checked('1', $options['popular_random']); } ?> />
     289
     290                                        <label class="widget_trigger">
     291                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_popular_random" name="gab_options[popular_random]" value="1" <?php if (isset($options['popular_random'])) { checked('1', $options['popular_random']); } ?> />
    280292                                            <span class="gab_switcher">
    281293                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    286298                                        <p><?php _e('Gabfire Random/Popular/Recent Posts: Display random, recent or most popular posts.','gabfire-widget-pack'); ?></p>
    287299                                    </div><!-- .gab_option_box_inner -->
    288                                 </div>             
    289                            
     300                                </div>
     301
    290302                            </div><!-- .gabfire-col-left -->
    291                            
    292                             <div class="gabfire-col-right">                 
    293                            
     303
     304                            <div class="gabfire-col-right">
     305
    294306                                <?php if(isset($options['flickrrss']) && $options['flickrrss'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    295                                 <div class="gab_option_box <?php echo $state; ?>">
     307                                <div class="gab_options_flickrrss gab_option_box <?php echo $state; ?>">
    296308                                    <div class="gab_option_box_inner">
    297309                                        <h3><?php _e('Flickr Images','gabfire-widget-pack'); ?></h3>
    298                                        
    299                                         <label class="widget_trigger">
    300                                             <input  type="checkbox" name="gab_options[flickrrss]" value="1" <?php if (isset($options['flickrrss'])) { checked('1', $options['flickrrss']); } ?> />
     310
     311                                        <label class="widget_trigger">
     312                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_flickrrss" name="gab_options[flickrrss]" value="1" <?php if (isset($options['flickrrss'])) { checked('1', $options['flickrrss']); } ?> />
    301313                                            <span class="gab_switcher">
    302314                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    307319                                        <p><?php _e('Choose the criteria and display Flickr photos on your site.','gabfire-widget-pack'); ?></p>
    308320                                    </div><!-- .gab_option_box_inner -->
    309                                 </div>                         
    310                            
     321                                </div>
     322
    311323                                <?php if(isset($options['archive_widget']) && $options['archive_widget'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    312                                 <div class="gab_option_box <?php echo $state; ?>">
     324                                <div class="gab_options_archive_widget gab_option_box <?php echo $state; ?>">
    313325                                    <div class="gab_option_box_inner">
    314326                                        <h3><?php _e('Archive Search','gabfire-widget-pack'); ?></h3>
    315                                        
    316                                         <label class="widget_trigger">
    317                                             <input  type="checkbox" name="gab_options[archive_widget]" value="1" <?php if (isset($options['archive_widget'])) { checked('1', $options['archive_widget']); } ?> />
     327
     328                                        <label class="widget_trigger">
     329                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_archive_widget" name="gab_options[archive_widget]" value="1" <?php if (isset($options['archive_widget'])) { checked('1', $options['archive_widget']); } ?> />
    318330                                            <span class="gab_switcher">
    319331                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    324336                                        <p><?php _e('A quick option for your visitors to search in archive of your website.','gabfire-widget-pack'); ?></p>
    325337                                    </div><!-- .gab_option_box_inner -->
    326                                 </div>             
    327                            
     338                                </div>
     339
    328340                                <?php if(isset($options['relatedposts']) && $options['relatedposts'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    329                                 <div class="gab_option_box <?php echo $state; ?>">
    330                                     <div class="gab_option_box_inner">             
     341                                <div class="gab_options_relatedposts gab_option_box <?php echo $state; ?>">
     342                                    <div class="gab_option_box_inner">
    331343                                        <h3><?php _e('Related Posts','gabfire-widget-pack'); ?></h3>
    332                                        
    333                                         <label class="widget_trigger">
    334                                             <input  type="checkbox" name="gab_options[relatedposts]" value="1" <?php if (isset($options['relatedposts'])) { checked('1', $options['relatedposts']); } ?> />
     344
     345                                        <label class="widget_trigger">
     346                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_relatedposts" name="gab_options[relatedposts]" value="1" <?php if (isset($options['relatedposts'])) { checked('1', $options['relatedposts']); } ?> />
    335347                                            <span class="gab_switcher">
    336348                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    342354                                    </div><!-- .gab_option_box_inner -->
    343355                                </div>
    344                                                    
     356
    345357                                <?php if(isset($options['search']) && $options['search'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    346                                 <div class="gab_option_box <?php echo $state; ?>">
    347                                     <div class="gab_option_box_inner">
     358                                <div class="gab_options_search gab_option_box <?php echo $state; ?>">
     359                                    <div class="gab_options_search gab_option_box_inner">
    348360                                        <h3><?php _e('Search','gabfire-widget-pack'); ?></h3>
    349                                        
    350                                         <label class="widget_trigger">
    351                                             <input  type="checkbox" name="gab_options[search]" value="1" <?php if (isset($options['search'])) { checked('1', $options['search']); } ?> />
     361
     362                                        <label class="widget_trigger">
     363                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_search" name="gab_options[search]" value="1" <?php if (isset($options['search'])) { checked('1', $options['search']); } ?> />
    352364                                            <span class="gab_switcher">
    353365                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    359371                                    </div><!-- .gab_option_box_inner -->
    360372                                </div>
    361                                                
     373
    362374                                <?php if(isset($options['share']) && $options['share'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    363                                 <div class="gab_option_box <?php echo $state; ?>">
    364                                     <div class="gab_option_box_inner">             
     375                                <div class="gab_options_share gab_option_box <?php echo $state; ?>">
     376                                    <div class="gab_option_box_inner">
    365377                                        <h3><?php _e('Share Posts','gabfire-widget-pack'); ?></h3>
    366                                        
    367                                         <label class="widget_trigger">
    368                                             <input  type="checkbox" name="gab_options[share]" value="1" <?php if (isset($options['share'])) { checked('1', $options['share']); } ?> />
     378
     379                                        <label class="widget_trigger">
     380                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_share" name="gab_options[share]" value="1" <?php if (isset($options['share'])) { checked('1', $options['share']); } ?> />
    369381                                            <span class="gab_switcher">
    370382                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    376388                                    </div><!-- .gab_option_box_inner -->
    377389                                </div>
    378                                
     390
    379391                                <?php if(isset($options['text_widget']) && $options['text_widget'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    380                                 <div class="gab_option_box <?php echo $state; ?>"> 
     392                                <div class="gab_options_text_widget gab_option_box <?php echo $state; ?>">
    381393                                    <div class="gab_option_box_inner">
    382394                                        <h3><?php _e('Gabfire Text+ Widget','gabfire-widget-pack'); ?></h3>
    383                                        
    384                                         <label class="widget_trigger">
    385                                             <input  type="checkbox" name="gab_options[text_widget]" value="1" <?php if (isset($options['text_widget'])) { checked('1', $options['text_widget']); } ?> />
     395
     396                                        <label class="widget_trigger">
     397                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_text_widget" name="gab_options[text_widget]" value="1" <?php if (isset($options['text_widget'])) { checked('1', $options['text_widget']); } ?> />
    386398                                            <span class="gab_switcher">
    387399                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    393405                                    </div><!-- .gab_option_box_inner -->
    394406                                </div>
    395                                                    
     407
    396408                                <?php if(isset($options['contact_info']) && $options['contact_info'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    397                                 <div class="gab_option_box <?php echo $state; ?>">
     409                                <div class="gab_options_contact_info gab_option_box <?php echo $state; ?>">
    398410                                    <div class="gab_option_box_inner">
    399411                                        <h3><?php _e('Contact Information','gabfire-widget-pack'); ?></h3>
    400                                        
    401                                         <label class="widget_trigger">
    402                                             <input  type="checkbox" name="gab_options[contact_info]" value="1" <?php if (isset($options['contact_info'])) { checked('1', $options['contact_info']); } ?> />
     412
     413                                        <label class="widget_trigger">
     414                                            <input  type="checkbox" class="gabfire_checkbox" id="gab_options_contact_info" name="gab_options[contact_info]" value="1" <?php if (isset($options['contact_info'])) { checked('1', $options['contact_info']); } ?> />
    403415                                            <span class="gab_switcher">
    404416                                                <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    409421                                        <p><?php _e('Display company logo and adress and phone number to your visitors','gabfire-widget-pack'); ?></p>
    410422                                    </div><!-- .gab_option_box_inner -->
    411                                 </div>     
    412                                
    413                             </div><!-- .gabfire-col-right -->       
    414                            
     423                                </div>
     424
     425                            </div><!-- .gabfire-col-right -->
     426
    415427                            <div class="clearfix"></div>
    416                                
     428
    417429                            <?php if(isset($options['recent_tweets']) && $options['recent_tweets'] == 1) { $state = "active"; } else { $state = "deactive"; } ?>
    418                             <div class="gab_option_box <?php echo $state; ?>">
     430                            <div class="gab_options_recent_tweets gab_option_box <?php echo $state; ?>">
    419431                                <div class="gab_option_box_inner">
    420432                                    <h3><?php _e('Recent Tweets','gabfire-widget-pack'); ?></h3>
    421                                    
     433
    422434                                    <label class="widget_trigger">
    423                                         <input  type="checkbox" name="gab_options[recent_tweets]" value="1" <?php if (isset($options['recent_tweets'])) { checked('1', $options['recent_tweets']); } ?> />
     435                                        <input  type="checkbox" class="gabfire_checkbox" id="gab_options_recent_tweets" name="gab_options[recent_tweets]" value="1" <?php if (isset($options['recent_tweets'])) { checked('1', $options['recent_tweets']); } ?> />
    424436                                        <span class="gab_switcher">
    425437                                            <span class="gab_switcheron"><?php _e('ON','gabfire-widget-pack'); ?></span>
     
    429441                                    </label>
    430442                                    <p><?php _e('Get recent Tweets based on an username or #hashtag. Visit <a target="_blank" href="https://dev.twitter.com/apps">https://dev.twitter.com/apps</a> to get your application and secret keys.','gabfire-widget-pack'); ?></p>
    431                                    
     443
    432444                                    <p><?php _e('','gabfire-widget-pack'); ?></p>
    433445                                    <div class="gabfire-col-left">
    434                                         <?php _e('Consumer Key','gabfire-widget-pack'); ?><input type="text" class="widefat" size="57" name="gab_options[key]" value="<?php echo $options['key']; ?>" />
    435                                         <?php _e('Consumer Secret','gabfire-widget-pack'); ?><input type="text" class="widefat" size="57" name="gab_options[secret]" value="<?php echo $options['secret']; ?>" />
     446                                        <?php _e('Consumer Key','gabfire-widget-pack'); ?><input type="text" class="widefat" size="57" name="gab_options[key]" value="<?php echo esc_attr($options['key']); ?>" />
     447                                        <?php _e('Consumer Secret','gabfire-widget-pack'); ?><input type="text" class="widefat" size="57" name="gab_options[secret]" value="<?php echo esc_attr($options['secret']); ?>" />
    436448                                    </div>
    437449                                    <div class="gabfire-col-right">
    438                                         <?php _e('Access Token Key','gabfire-widget-pack'); ?><input type="text" class="widefat" size="57" name="gab_options[token_key]" value="<?php echo $options['token_key']; ?>" />
    439                                         <?php _e('Access Token Secret','gabfire-widget-pack'); ?><input type="text" class="widefat" size="57" name="gab_options[token_secret]" value="<?php echo $options['token_secret']; ?>" />
     450                                        <?php _e('Access Token Key','gabfire-widget-pack'); ?><input type="text" class="widefat" size="57" name="gab_options[token_key]" value="<?php echo esc_attr($options['token_key']); ?>" />
     451                                        <?php _e('Access Token Secret','gabfire-widget-pack'); ?><input type="text" class="widefat" size="57" name="gab_options[token_secret]" value="<?php echo esc_attr($options['token_secret']); ?>" />
    440452                                    </div>
    441453                                    <div class="clearfix"></div>
    442454                                </div><!-- .gab_option_box_inner -->
    443                             </div>                         
     455                            </div>
    444456                        </div> <!-- .inside -->
    445                        
     457
    446458                        <div class="gabfire_options_submit submit-bottom">
    447459                            <p class="activate_widgets_notice"><?php _e('Activate the widgets you wish to enable and <strong>Save Changes</strong>','gabfire-widget-pack'); ?></p>
    448460                            <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'gabfire-widget-pack') ?>" />
    449                         </div>                     
     461                        </div>
    450462                    </div><!-- .postbox -->
    451463                </form>
     
    454466
    455467    </div> <!-- .metabox-holder -->
    456    
    457 </div> <!-- .wrap -->   
    458 
    459 <?php   
     468
     469</div> <!-- .wrap -->
     470
     471<?php
    460472}
    461473
     
    464476    // strip html from textboxes
    465477    // Sanitize textbox input (strip html tags, and escape characters)
    466     $input['key'] =  wp_filter_nohtml_kses($input['key']); 
     478    $input['key'] =  wp_filter_nohtml_kses($input['key']);
    467479    $input['secret'] =  wp_filter_nohtml_kses($input['secret']);
    468480    $input['token_key'] =  wp_filter_nohtml_kses($input['token_key']);
  • gabfire-widget-pack/trunk/gabfire-widgets.php

    r921164 r925774  
    55    Description: This plugin adds a bundle of the most commonly used widgets to your site.
    66    Author: Gabfire Themes
    7     Version: 1.3.4
     7    Version: 1.3.5
    88    Author URI: http://www.gabfirethemes.com
    9    
     9
    1010    Copyright 2013 Gabfire Themes (email : info@gabfire.com)
    1111
    1212    This program is free software; you can redistribute it and/or modify
    13     it under the terms of the GNU General Public License, version 2, as 
     13    it under the terms of the GNU General Public License, version 2, as
    1414    published by the Free Software Foundation.
    1515
     
    1717    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1818    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19     GNU General Public License for more details.   
     19    GNU General Public License for more details.
    2020*/
    2121
    22 define( 'GABFIRE_WIDGETS_VERSION', '1.3.4');
     22define( 'GABFIRE_WIDGETS_VERSION', '1.3.5');
    2323define( 'GABFIRE_WIDGETS_DIR', dirname(__FILE__) );
    2424define( 'GABFIRE_WIDGETS_URL', plugins_url().'/gabfire-widget-pack' );
     
    3333}
    3434
     35add_action('init', 'gabfire_widget_pack_load_plugin_textdomain');
     36
     37function gabfire_widget_pack_load_plugin_textdomain() {
     38    load_plugin_textdomain('gabfire-widget-pack', false, basename( dirname( __FILE__ ) ) . '/lang');
     39}
     40
    3541require_once( GABFIRE_WIDGETS_DIR .  '/admin/options.php' );
    3642$gabfire_options = get_option('gab_options');
     
    4349 * Check to see if there is an option if not set to default option
    4450 */
    45  
     51
    4652$gabfire_default_option = array(
    4753    'about_widget'      => 0,
  • gabfire-widget-pack/trunk/readme.txt

    r921164 r925774  
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
    10 The Gabfire Widget Pack contains over a dozen useful widgets to extend your WordPress site. It is a free plugin that will work with ANY theme. 
     10The Gabfire Widget Pack contains over a dozen useful widgets to extend your WordPress site. It is a free plugin that will work with ANY theme.
    1111
    1212== Description ==
    1313
    14 The Gabfire Widget Pack is a feature-packed plugin that adds the most commonly used widgets to your site. Rather than having to download several plugins by various authors, this plugin bundles together the most popular widgets. 
     14The Gabfire Widget Pack is a feature-packed plugin that adds the most commonly used widgets to your site. Rather than having to download several plugins by various authors, this plugin bundles together the most popular widgets.
    1515
    1616It is maintained by the folks over at http://www.gabfirethemes.com
     
    2424* By Hashtag
    2525
    26 This widget uses the latest Twitter oAuth method to retrieve tweets to ensure compatibility. 
     26This widget uses the latest Twitter oAuth method to retrieve tweets to ensure compatibility.
    2727
    2828= Widget: Archive Search =
     
    3131* By Archive Month
    3232* By Category
    33 * By Keyword using Google Search 
     33* By Keyword using Google Search
    3434
    3535This is great widget for content-heavy sites.
     
    4141* Retrieve images based on tag
    4242* Determine order of images
    43 * Determine the number and size of images 
     43* Determine the number and size of images
    4444
    4545This is one of those quick set it and forget it widgets that does wonders for your site.
     
    4949
    5050* Set your label
    51 * Set your style and background 
     51* Set your style and background
    5252
    5353Search is not dead!
     
    5656Every site has a social media presence. Let your visitors find your across any of the social media platforms with this widget.
    5757
    58 * Simply provide links to your social media networks 
     58* Simply provide links to your social media networks
    5959
    6060= Widget: Post Tabs =
     
    6363* Recent Posts
    6464* Recent Comments
    65 * Popular Posts (based on tags) 
     65* Popular Posts (based on tags)
    6666
    6767In addition, the Post Tabs widget offers a light and dark color scheme, ability to show post meta details and avatars, and choose the number of posts to display.
     
    7373* Author's Gravatar (if any)
    7474* Author's social media links
    75 * Link to Author's Posts 
     75* Link to Author's Posts
    7676
    7777Author badge shows at single post and author pages only. This badge will not shown if Author bio is left empty. Go to User profile page to enter Facebook, Twitter, Google+, and Author website URL details.
     
    8989* Twitter Share
    9090* Google+ Box
    91 * Pinterest Pin 
     91* Pinterest Pin
    9292
    9393= Widget: Text+ Widget =
    94 A slight twist on the original. This text widget gives you the ability to have an icon and button that links to any post or page of your choice. 
     94A slight twist on the original. This text widget gives you the ability to have an icon and button that links to any post or page of your choice.
    9595
    96 For more details, visit [Gabfire Themes] (http://www.gabfirethemes.com "Best WordPress Themes"). 
     96For more details, visit [Gabfire Themes] (http://www.gabfirethemes.com "Best WordPress Themes").
    9797
    9898== Installation ==
    9999
    100 You can install the Gabfire Widget Pack from your WordPress Dashboard or manually via FTP. 
     100You can install the Gabfire Widget Pack from your WordPress Dashboard or manually via FTP.
    101101
    102102= From WordPress Dashboard =
    103103
    104 # Navigate to 'Plugins -> Add New' from your WordPress dashboard. 
    105 # Search for `Gabfire Widget Pack` and install it. 
     104# Navigate to 'Plugins -> Add New' from your WordPress dashboard.
     105# Search for `Gabfire Widget Pack` and install it.
    106106# Activate the plugin from Plugins menu.
    107107# Enable the widgets you wish to activate from Appearance -> Gabfire Widget Pack
     
    135135== Changelog ==
    136136
    137 New Changes
     137= 1.3.5 =
     138* Fixes bug with internationalization
    138139
    139140= 1.3.4 =
  • gabfire-widget-pack/trunk/widget-ajaxtabs.php

    r911607 r925774  
    44if (!function_exists('gabfire_ajaxtabs_js')) {
    55    function gabfire_ajaxtabs_js() {
    6         wp_deregister_script( 'jquery' ); 
     6        wp_deregister_script( 'jquery' );
    77        wp_enqueue_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
    8         wp_enqueue_script('jquerytools', plugins_url() .'/gabfire-widget-pack/js/jquery.tools.min.js',array( 'jquery' ));   
     8        wp_enqueue_script('jquerytools', plugins_url() .'/gabfire-widget-pack/js/jquery.tools.min.js',array( 'jquery' ));
    99    }
    1010}
     
    1212/* AJAX TABS */
    1313class gabfire_ajaxtabs extends WP_Widget {
    14  
     14
    1515    function gabfire_ajaxtabs() {
    1616        $widget_ops = array( 'classname' => 'gabfire_ajaxtabs', 'description' => 'Display recent entries and comments (ajax tab supported)' );
     
    1818        $this->WP_Widget( 'gabfire_ajaxtabs', 'Gabfire: Posts Tabs Widget', $widget_ops, $control_ops);
    1919    }
    20  
    21     function widget($args, $instance) {   
     20
     21    function widget($args, $instance) {
     22
     23        global $post;
     24
    2225        extract( $args );
    2326        $title  = $instance['title'];
     
    4851                    <?php if (intval($comment_nr) > 0 ) { ?><li class="gab_thirdtab"><a href="#second"><?php echo esc_attr( $comment_label ); ?></a></li><?php } ?>
    4952                </ul>
    50                
     53
    5154                <div class="panes">
    5255                    <?php if (intval($post_nr) > 0 ) { ?>
     
    5760                        <ul>
    5861                            <?php
    59                             $count=1;
    60                             $args = array( 'posts_per_page'=> $post_nr, );                     
    61                             $gab_query = new WP_Query();$gab_query->query($args); 
     62                            $count = 1;
     63                            $args = array( 'posts_per_page'=> $post_nr, );
     64                            $gab_query = new WP_Query();$gab_query->query($args);
    6265                            while ($gab_query->have_posts()) : $gab_query->the_post();
    6366                            ?>
     
    7376                                            'enable_thumb' => 1,
    7477                                            'resize_type' => 'c',
    75                                             'media_width' => 35, 
    76                                             'media_height' => 35, 
     78                                            'media_width' => 35,
     79                                            'media_height' => 35,
    7780                                            'enable_default' => 0
    7881                                        ));
     
    8992                    </div>
    9093                    <?php } ?>
    91                    
     94
    9295                    <?php if (intval($popular_nr) > 0 ) { ?>
    9396                    <div>
     
    98101                            <?php
    99102                            $count=1;
    100                             $args = array( 'posts_per_page'=> $popular_nr, 'orderby' => 'comment_count');                       
    101                             $gab_query = new WP_Query();$gab_query->query($args); 
     103                            $args = array( 'posts_per_page'=> $popular_nr, 'orderby' => 'comment_count');
     104                            $gab_query = new WP_Query();$gab_query->query($args);
    102105                            while ($gab_query->have_posts()) : $gab_query->the_post();
    103106                            ?>
     
    113116                                            'enable_thumb' => 1,
    114117                                            'resize_type' => 'c',
    115                                             'media_width' => 35, 
    116                                             'media_height' => 35, 
     118                                            'media_width' => 35,
     119                                            'media_height' => 35,
    117120                                            'enable_default' => 0
    118121                                        ));
    119                                     } else { 
     122                                    } else {
    120123                                        echo get_the_post_thumbnail($post->ID, 'thumbnail');
    121                                     }                           
     124                                    }
    122125                                    ?>
    123126                                    <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'gabfire-widget-pack' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
     
    144147                                $comments = get_comments($args);
    145148                                foreach($comments as $comment) :
    146                                     echo '<li class="no-list-image">'; 
     149                                    echo '<li class="no-list-image">';
    147150                                        if($avatar) {
    148151                                            echo get_avatar( $comment->comment_author_email, 35 );
     
    157160                </div>
    158161            </div>
    159    
    160             <?php 
    161            
    162         echo $after_widget; 
     162
     163            <?php
     164
     165        echo $after_widget;
    163166    }
    164167
     
    169172        $instance['a_avatar']   = $new_instance['a_avatar'] ? '1' : '0';
    170173        $instance['colorsc']    = $new_instance['colorsc'] ? '1' : '0';
    171         $instance['post_nr'] = (int) $new_instance['post_nr']; 
     174        $instance['post_nr'] = (int) $new_instance['post_nr'];
    172175        $instance['post_title'] = ( ! empty( $new_instance['post_title'] ) ) ? sanitize_text_field( $new_instance['post_title'] ) : '';
    173176        $instance['popular_title']  = ( ! empty( $new_instance['popular_title'] ) ) ? sanitize_text_field( $new_instance['popular_title'] ) : '';
     
    175178        $instance['comment_label']  = ( ! empty( $new_instance['comment_label'] ) ) ? sanitize_text_field( $new_instance['comment_label'] ) : '';
    176179        $instance['popular_label']  = ( ! empty( $new_instance['popular_label'] ) ) ? sanitize_text_field( $new_instance['popular_label'] ) : '';
    177         $instance['comment_nr']     = (int) $new_instance['comment_nr']; 
    178         $instance['popular_nr']     = (int) $new_instance['popular_nr']; 
     180        $instance['comment_nr']     = (int) $new_instance['comment_nr'];
     181        $instance['popular_nr']     = (int) $new_instance['popular_nr'];
    179182        return $new_instance;
    180183    }
    181  
     184
    182185    function form($instance) {
    183         $defaults = array( 
     186        $defaults = array(
    184187            'title' => 'Posts',
    185188            'post_label' => 'Latest',
    186189            'comment_label' => 'Comments',
    187190            'popular_label' => 'Popular',
    188             'post_nr' => '5', 
     191            'post_nr' => '5',
    189192            'comment_nr' => '5',
    190193            'popular_nr' => '5',
     
    196199            'a_avatar' => '1',
    197200        );
    198         $instance = wp_parse_args( (array) $instance, $defaults ); 
     201        $instance = wp_parse_args( (array) $instance, $defaults );
    199202        ?>
    200203
     
    203206            <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>" />
    204207        </p>
    205        
     208
    206209        <p>
    207210            <label for="<?php echo $this->get_field_id('post_label'); ?>"><?php _e('Recent Posts tab label','gabfire-widget-pack'); ?></label>
    208211            <input class="widefat" id="<?php echo $this->get_field_id('post_label'); ?>" name="<?php echo $this->get_field_name('post_label'); ?>" type="text" value="<?php echo esc_attr($instance['post_label']); ?>" />
    209212        </p>
    210        
     213
    211214        <p>
    212215            <label for="<?php echo $this->get_field_id('comment_label'); ?>"><?php _e('Comments tab label','gabfire-widget-pack'); ?></label>
    213216            <input class="widefat" id="<?php echo $this->get_field_id('comment_label'); ?>" name="<?php echo $this->get_field_name('comment_label'); ?>" type="text" value="<?php echo esc_attr($instance['comment_label']); ?>" />
    214217        </p>
    215        
     218
    216219        <p>
    217220            <label for="<?php echo $this->get_field_id('popular_label'); ?>"><?php _e('Popular tab label','gabfire-widget-pack'); ?></label>
    218221            <input class="widefat" id="<?php echo $this->get_field_id('popular_label'); ?>" name="<?php echo $this->get_field_name('popular_label'); ?>" type="text" value="<?php echo esc_attr($instance['popular_label']); ?>" />
    219222        </p>
    220        
     223
    221224        <p>
    222225            <label for="<?php echo $this->get_field_id('post_title'); ?>"><?php _e('Recent Posts List Title','gabfire-widget-pack'); ?></label>
    223226            <input class="widefat" id="<?php echo $this->get_field_id('post_title'); ?>" name="<?php echo $this->get_field_name('post_title'); ?>" type="text" value="<?php echo esc_attr($instance['post_title']); ?>" />
    224227        </p>
    225        
     228
    226229        <p>
    227230            <label for="<?php echo $this->get_field_id('popular_title'); ?>"><?php _e('Popular Posts List Title','gabfire-widget-pack'); ?></label>
    228231            <input class="widefat" id="<?php echo $this->get_field_id('popular_title'); ?>" name="<?php echo $this->get_field_name('popular_title'); ?>" type="text" value="<?php echo esc_attr($instance['popular_title']); ?>" />
    229         </p>       
    230        
     232        </p>
     233
    231234        <p>
    232235            <label for="<?php echo $this->get_field_id('comments_title'); ?>"><?php _e('Comments List Title','gabfire-widget-pack'); ?></label>
     
    235238
    236239        <p>
    237             <label for="<?php echo $this->get_field_id( 'colorsc' ); ?>"><?php _e('Color Scheme','gabfire-widget-pack'); ?></label> 
     240            <label for="<?php echo $this->get_field_id( 'colorsc' ); ?>"><?php _e('Color Scheme','gabfire-widget-pack'); ?></label>
    238241            <select id="<?php echo $this->get_field_id( 'colorsc' ); ?>" name="<?php echo $this->get_field_name( 'colorsc' ); ?>">
    239242                <option value="1" <?php selected( $instance['colorsc'], '1' ); ?>><?php _e('Light','gabfire-widget-pack'); ?></option>
    240                 <option value="0" <?php selected( $instance['colorsc'], '0' ); ?>><?php _e('Dark','gabfire-widget-pack'); ?></option>   
    241             </select>
    242         </p>           
    243        
    244         <p>
    245             <label for="<?php echo $this->get_field_id( 'postmeta' ); ?>"><?php _e('Display post meta below title','gabfire-widget-pack'); ?></label> 
     243                <option value="0" <?php selected( $instance['colorsc'], '0' ); ?>><?php _e('Dark','gabfire-widget-pack'); ?></option>
     244            </select>
     245        </p>
     246
     247        <p>
     248            <label for="<?php echo $this->get_field_id( 'postmeta' ); ?>"><?php _e('Display post meta below title','gabfire-widget-pack'); ?></label>
    246249            <select id="<?php echo $this->get_field_id( 'postmeta' ); ?>" name="<?php echo $this->get_field_name( 'postmeta' ); ?>">
    247250                <option value="1" <?php selected( $instance['postmeta'] , '1' ); ?>><?php _e('Enable','gabfire-widget-pack'); ?></option>
    248                 <option value="0" <?php selected( $instance['postmeta'] , '0' ); ?>><?php _e('Disable','gabfire-widget-pack'); ?></option> 
    249             </select>
    250         </p>   
    251        
    252         <p>
    253             <label for="<?php echo $this->get_field_id( 'a_avatar' ); ?>"><?php _e('Display author avatar for comments','gabfire-widget-pack'); ?></label> 
     251                <option value="0" <?php selected( $instance['postmeta'] , '0' ); ?>><?php _e('Disable','gabfire-widget-pack'); ?></option>
     252            </select>
     253        </p>
     254
     255        <p>
     256            <label for="<?php echo $this->get_field_id( 'a_avatar' ); ?>"><?php _e('Display author avatar for comments','gabfire-widget-pack'); ?></label>
    254257            <select id="<?php echo $this->get_field_id( 'a_avatar' ); ?>" name="<?php echo $this->get_field_name( 'a_avatar' ); ?>">
    255258                <option value="1" <?php selected( $instance['a_avatar'], '1' ); ?>><?php _e('Enable','gabfire-widget-pack'); ?></option>
    256                 <option value="0" <?php selected( $instance['a_avatar'], '0' ); ?>><?php _e('Disable','gabfire-widget-pack'); ?></option>   
    257             </select>
    258         </p>   
    259        
     259                <option value="0" <?php selected( $instance['a_avatar'], '0' ); ?>><?php _e('Disable','gabfire-widget-pack'); ?></option>
     260            </select>
     261        </p>
     262
    260263        <p>
    261264            <label for="<?php echo $this->get_field_name( 'post_nr' ); ?>"><?php _e('Number of posts','gabfire-widget-pack'); ?></label>
    262             <select id="<?php echo $this->get_field_id( 'post_nr' ); ?>" name="<?php echo $this->get_field_name( 'post_nr' ); ?>">         
     265            <select id="<?php echo $this->get_field_id( 'post_nr' ); ?>" name="<?php echo $this->get_field_name( 'post_nr' ); ?>">
    263266            <?php
    264267                for ( $i = 0; $i <= 15; ++$i )
     
    266269            ?>
    267270            </select>
    268         </p>   
    269        
     271        </p>
     272
    270273        <p>
    271274            <label for="<?php echo $this->get_field_name( 'comment_nr' ); ?>"><?php _e('Number of Comments','gabfire-widget-pack'); ?></label>
    272             <select id="<?php echo $this->get_field_id( 'comment_nr' ); ?>" name="<?php echo $this->get_field_name( 'comment_nr' ); ?>">           
     275            <select id="<?php echo $this->get_field_id( 'comment_nr' ); ?>" name="<?php echo $this->get_field_name( 'comment_nr' ); ?>">
    273276            <?php
    274277                for ( $i = 0; $i <= 15; ++$i )
     
    277280            </select>
    278281        </p>
    279        
     282
    280283        <p>
    281284            <label for="<?php echo $this->get_field_name( 'popular_nr' ); ?>"><?php _e('Number of Popular Posts','gabfire-widget-pack'); ?></label>
    282             <select id="<?php echo $this->get_field_id( 'popular_nr' ); ?>" name="<?php echo $this->get_field_name( 'popular_nr' ); ?>">           
     285            <select id="<?php echo $this->get_field_id( 'popular_nr' ); ?>" name="<?php echo $this->get_field_name( 'popular_nr' ); ?>">
    283286            <?php
    284287                for ( $i = 0; $i <= 15; ++$i )
Note: See TracChangeset for help on using the changeset viewer.