Changeset 577192
- Timestamp:
- 07/25/2012 02:33:38 PM (13 years ago)
- Location:
- aweber-subscribers-count/trunk
- Files:
-
- 3 edited
-
aweber-count-optin.php (modified) (9 diffs)
-
aweber-count-shortcode.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
aweber-subscribers-count/trunk/aweber-count-optin.php
r551058 r577192 5 5 Description: This plugin adds a shortcode ability to your list counts. 6 6 Author: Alex from WP Themes Pro 7 Author URI: http://wp-themes-pro ;com8 Version: 1. 2.07 Author URI: http://wp-themes-pro.com 8 Version: 1.5.0 9 9 License: GNU General Public License v3.0 10 10 License URI: http://www.opensource.org/licenses/gpl-license.php … … 125 125 'count' => '', 126 126 'show' => 1, 127 'inc_unsubscribed' => '', 127 128 'check_text' => 'Subscribe me to your mailing list', 128 129 'subscribed_text' => 'You are currently subscribed to our mailing list', … … 264 265 public function admin_menu() { 265 266 266 add_options_page( __( ' Count Settings', 'tgm-aw-optin' ), __( 'AW Count Optin', 'tgm-aw-optin' ), 'manage_options', 'tgm-aweber-count-settings', array( &$this, 'settings_page' ) );267 add_options_page( __( 'Aweber Subscriber Count Settings', 'tgm-aw-optin' ), __( 'AW Sub Count', 'tgm-aw-optin' ), 'manage_options', 'tgm-aweber-count-settings', array( &$this, 'settings_page' ) ); 267 268 268 269 } … … 291 292 <?php } else { ?> 292 293 <form id="tgm-aw-options" action="options.php" method="post"> 293 <?php settings_fields( $this->option ); ?> 294 <?php 295 296 settings_fields( $this->option ); ?> 294 297 <?php $this->get_form_options(); ?> 295 298 </form> … … 317 320 <div class="content"> 318 321 <p><?php _e( 'In order to allow the plugin to access your Aweber information, you need to grant it access. Once you have logged in and granted Aweber access, Aweber will give you an authorization token. Copy the authorization token into the field below and click the Login button to grant the plugin access to your Aweber account.', 'tgm-aw-optin' ); ?></p> 319 <p><a onclick="window.open( this.href, '', 'resizable=yes,location=no,width=750,height=525,top=0,left=0' ); return false;" href="https://auth.aweber.com/1.0/oauth/authorize_app/ d3cbfebf" class="button-secondary get-auth"><?php _e( 'Click Here to Get Your Authorization Token', 'tgm-aw-optin' ); ?></a></p>322 <p><a onclick="window.open( this.href, '', 'resizable=yes,location=no,width=750,height=525,top=0,left=0' ); return false;" href="https://auth.aweber.com/1.0/oauth/authorize_app/0a7a1ce8" class="button-secondary get-auth"><?php _e( 'Click Here to Get Your Authorization Token', 'tgm-aw-optin' ); ?></a></p> 320 323 </div> 321 324 </div> … … 374 377 <table class="form-table"> 375 378 <tbody> 376 <tr valign="middle"> 379 <tr valign="top" > 380 <th scope="row"> 381 <label><?php _e( 'How to use Aweber Subscriber Count', 'tgm-aw-optin' ); ?></label> 382 </th> 383 <td> 384 <p><strong>Paste the shortcode with your list name in any post, page or text widget:</strong><br/>[displaycount list="your_list_name"]</p> 385 386 <p><strong>You can combine lists using this shortcode :</strong><br/>[displaycount list="your_list_name_1,your_list_name_2"]</p> 387 388 <p><strong>If you want to display a list count anywhere in your theme, use :</strong><br/>echo do_shortcode('[displaycount list="your_list_name"]');</p> 389 390 </td> 391 </tr> 392 393 <tr valign="middle" > 394 395 </tr> 396 397 <tr valign="middle" > 398 <th scope="row"> 399 <label for="<?php echo $this->option; ?>[inc_unsubscribed]"><?php _e( 'Include Un-subscribed members in count?', 'tgm-aw-optin' ); ?></label> 400 </th> 401 <td> 402 <input id="tgm-aw-inc_unsubscribed" type="checkbox" name="<?php echo $this->option; ?>[inc_unsubscribed]" value="<?php echo $tgm_aw_options['inc_unsubscribed']; ?>" <?php checked( $tgm_aw_options['inc_unsubscribed'], 1 ); ?> /> <?php _e( 'Tick in order to display the Grand Total count.<br/>Untick to display your real subscriber count.', 'tgm-aw-optin' ); ?> 403 </td> 404 </tr> 405 406 <tr valign="middle" style="display:none;"> 377 407 <th scope="row"> 378 408 <label for="<?php echo $this->option; ?>[current_list_name]"><?php _e( 'Select the list that you want to show count', 'tgm-aw-optin' ); ?></label> … … 396 426 </td> 397 427 </tr> 398 <tr valign="middle" style="display:none;"> 399 <th scope="row"> 400 <label for="<?php echo $this->option; ?>[show]"><?php _e( 'Display the checkbox after the count form?', 'tgm-aw-optin' ); ?></label> 401 </th> 402 <td> 403 <input id="tgm-aw-show" type="checkbox" name="<?php echo $this->option; ?>[show]" value="<?php echo $tgm_aw_options['show']; ?>" <?php checked( $tgm_aw_options['show'], 1 ); ?> /> 404 </td> 405 </tr> 406 <tr valign="middle" style="display:none;"> 407 <th scope="row"> 408 <label for="<?php echo $this->option; ?>[check_text]"><?php _e( 'Customize the checkbox message', 'tgm-aw-optin' ); ?></label> 409 </th> 410 <td> 411 <input id="tgm-aw-check-text" type="text" name="<?php echo $this->option; ?>[check_text]" size="55" value="<?php echo $tgm_aw_options['check_text']; ?>" /> 412 </td> 413 </tr> 414 <tr valign="middle" style="display:none;"> 415 <th scope="row"> 416 <label for="<?php echo $this->option; ?>[subscribed_text]"><?php _e( 'Customize the already subscribed message', 'tgm-aw-optin' ); ?></label> 417 </th> 418 <td> 419 <input id="tgm-aw-subscribed-text" type="text" name="<?php echo $this->option; ?>[subscribed_text]" size="55" value="<?php echo $tgm_aw_options['subscribed_text']; ?>" /> 420 </td> 421 </tr> 422 <tr valign="middle" style="display:none;"> 423 <th scope="row"> 424 <label for="<?php echo $this->option; ?>[pending_text]"><?php _e( 'Customize the pending subscriber message', 'tgm-aw-optin' ); ?></label> 425 </th> 426 <td> 427 <input id="tgm-aw-pending-text" type="text" name="<?php echo $this->option; ?>[pending_text]" size="55" value="<?php echo $tgm_aw_options['pending_text']; ?>" /> 428 </td> 429 </tr> 430 <tr valign="middle" style="display:none;"> 431 <th scope="row"> 432 <label for="<?php echo $this->option; ?>[admin_text]"><?php _e( 'Customize the admin logged in message', 'tgm-aw-optin' ); ?></label> 433 </th> 434 <td> 435 <input id="tgm-aw-admin-text" type="text" name="<?php echo $this->option; ?>[admin_text]" size="55" value="<?php echo $tgm_aw_options['admin_text']; ?>" /> 436 </td> 437 </tr> 438 <tr valign="middle" style="display:none;"> 439 <th scope="row"> 440 <label for="<?php echo $this->option; ?>[clear]"><?php _e( 'Add a CSS \'clear\' to the checkbox?', 'tgm-aw-optin' ); ?></label> 441 </th> 442 <td> 443 <input id="tgm-aw-clear" type="checkbox" name="<?php echo $this->option; ?>[clear]" value="<?php echo $tgm_aw_options['clear']; ?>" <?php checked( $tgm_aw_options['clear'], 1 ); ?> /> 444 <span class="description"><?php _e( 'Uncheck if this causes layout issues', 'tgm-aw-optin' ); ?></span> 445 </td> 446 </tr> 447 <tr valign="middle" style="display:none;"> 448 <th scope="row"> 449 <label for="<?php echo $this->option; ?>[check]"><?php _e( 'Check for pending or active subscribers?', 'tgm-aw-optin' ); ?></label> 450 </th> 451 <td> 452 <input id="tgm-aw-check" type="checkbox" name="<?php echo $this->option; ?>[check]" value="<?php echo $tgm_aw_options['check']; ?>" <?php checked( $tgm_aw_options['check'], 1 ); ?> /> 453 <span class="description"><?php _e( 'When checked, this plugin queries your active list for the email address submitted to return the appropriate string and data. Large email lists may consider unchecking this option if performance issues arise.', 'tgm-aw-optin' ); ?></span> 454 </td> 455 </tr> 428 456 429 </tbody> 457 430 </table> … … 464 437 ); 465 438 ?> 439 <div id="asc_credits"><?php _e( 'Thanks for using my plugin, I hope it helps you as much as me :)<br/>If you\'re looking for great WP Themes, check out my blog : http://wp-themes-pro.com'); ?></div> 466 440 </div> 441 467 442 </div> 468 443 <?php … … 508 483 509 484 $tgm_aw_options['show'] = isset( $input['show'] ) ? (int) 1 : (int) 0; 510 485 $tgm_aw_options['inc_unsubscribed'] = isset( $input['inc_unsubscribed'] ) ? (int) 1 : (int) 0; 511 486 $tgm_aw_options['check_text'] = esc_attr( strip_tags( $input['check_text'] ) ); 512 487 $tgm_aw_options['subscribed_text'] = esc_attr( strip_tags( $input['subscribed_text'] ) ); -
aweber-subscribers-count/trunk/aweber-count-shortcode.php
r551058 r577192 43 43 $user_account = $aweber->getAccount( $tgm_aw_options['user_token'], $tgm_aw_options['user_token_secret'] ); 44 44 $acc = $user_account->lists->data; 45 $list=explode(",",$list); 45 46 //echo '<pre>'; print_r($acc); 46 if(empty($list)){ 47 //print_r($tgm_aw_options); die; 48 if(count($list)<=0){ 47 49 for ($i = 0; $i< count($acc['entries']); $i++) 48 50 { 49 51 if ( $acc['entries'][$i]['name'] == $tgm_aw_options['current_list_name'] ) 50 return $acc['entries'][$i]['total_subscribers']; 52 { 53 if($tgm_aw_options['inc_unsubscribed']=='1') 54 return $acc['entries'][$i]['total_subscribers']; 55 else 56 return $acc['entries'][$i]['total_subscribed_subscribers']; 57 58 } 51 59 //echo $value; 52 60 } 53 61 } else { 62 //print_r($list); 63 $subscriber_count=0; //initially set the subscriber count to 0; 54 64 for ($i = 0; $i< count($acc['entries']); $i++) 55 65 { 56 if ( $acc['entries'][$i]['name'] == $list ) 57 return $acc['entries'][$i]['total_subscribers']; 66 67 if (in_array( $acc['entries'][$i]['name'], $list) ) 68 { 69 70 if($tgm_aw_options['inc_unsubscribed']=='1') //check if options for include unsubscribers in count is ON 71 $subscriber_count += (int)$acc['entries'][$i]['total_subscribers']; //This is the total no of Subsribers including unsubscribers as well 72 else 73 $subscriber_count+= (int)$acc['entries'][$i]['total_subscribed_subscribers']; // This is the total subscribers exluding unsubscribed. 74 } 75 58 76 //echo $value; 59 77 } 78 return $subscriber_count; 60 79 } 61 80 -
aweber-subscribers-count/trunk/readme.txt
r551063 r577192 1 === Aweber Subscriber Count ===1 === Aweber Subscribers Count === 2 2 Contributors: alexandreb3 3 3 Donate link: 4 4 Tags: aweber, counter, list 5 5 Requires at least: 3.0 6 Tested up to: 3. 3.27 Stable tag: 1. 26 Tested up to: 3.4.1 7 Stable tag: 1.5 8 8 License: GNU General Public License v3.0 9 9 License URI: http://www.opensource.org/licenses/gpl-license.php … … 17 17 The plugin has an option page in order to connect to the aweber account and select the list you want to use. 18 18 19 The user will use the shortcode [displaycount] to display the subscriber count anywhere in posts or pages. 19 Paste the shortcode with your list name in any post, page or widget: [displaycount list="your_list_name"] 20 20 21 Advanced Use: If you already know your list name appropiately,paste the shortcode '[displaycount list="your list name"]'. 21 You can combine lists using this shortcode : [displaycount list="your_list_name_1,your_list_name_2"] 22 23 You can display your list count anywhere in your theme by using <?php echo do_shortcode('[displaycount list="your_list_name"]'); ?> 22 24 23 25 == Installation == … … 27 29 1. Normal Plugin install. 28 30 2. Go to settings page & get the authentication secret. 29 3. Select The list in setting page you want to show in front end. 30 4. Paste shortcode anywhere including any sidebar text widget '[displaycount]'. 31 3. Paste shortcode anywhere including any sidebar text widget : [displaycount list="your_list_name"]. 31 32 32 33 == Frequently Asked Questions == … … 38 39 == Changelog == 39 40 41 = 1.5 = 42 - Combination of list count 43 - You can now choose to use the subscribed count or the grand total count 44 40 45 = 1.2 = 46 - Release
Note: See TracChangeset
for help on using the changeset viewer.