Plugin Directory

Changeset 577192


Ignore:
Timestamp:
07/25/2012 02:33:38 PM (13 years ago)
Author:
alexandreb3
Message:

version 1.5

Location:
aweber-subscribers-count/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • aweber-subscribers-count/trunk/aweber-count-optin.php

    r551058 r577192  
    55Description: This plugin adds a shortcode ability to your list counts.
    66Author: Alex from WP Themes Pro
    7 Author URI: http://wp-themes-pro;com
    8 Version: 1.2.0
     7Author URI: http://wp-themes-pro.com
     8Version: 1.5.0
    99License: GNU General Public License v3.0
    1010License URI: http://www.opensource.org/licenses/gpl-license.php
     
    125125                'count'                 => '',
    126126                'show'                  => 1,
     127                'inc_unsubscribed'      => '',
    127128                'check_text'            => 'Subscribe me to your mailing list',
    128129                'subscribed_text'       => 'You are currently subscribed to our mailing list',
     
    264265        public function admin_menu() {
    265266       
    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' ) );
    267268       
    268269        }
     
    291292                    <?php } else { ?>
    292293                        <form id="tgm-aw-options" action="options.php" method="post">
    293                             <?php settings_fields( $this->option ); ?>
     294                            <?php
     295                           
     296                             settings_fields( $this->option ); ?>
    294297                            <?php $this->get_form_options(); ?>
    295298                        </form>
     
    317320                <div class="content">
    318321                    <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>
    320323                </div>
    321324            </div>
     
    374377                    <table class="form-table">
    375378                        <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;">
    377407                                <th scope="row">
    378408                                    <label for="<?php echo $this->option; ?>[current_list_name]"><?php _e( 'Select the list that you want to show count', 'tgm-aw-optin' ); ?></label>
     
    396426                                </td>
    397427                            </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                           
    456429                        </tbody>
    457430                    </table>
     
    464437                        );
    465438                    ?>
     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>
    466440                </div>
     441               
    467442            </div>
    468443            <?php
     
    508483           
    509484            $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;
    511486            $tgm_aw_options['check_text'] = esc_attr( strip_tags( $input['check_text'] ) );
    512487            $tgm_aw_options['subscribed_text'] = esc_attr( strip_tags( $input['subscribed_text'] ) );
  • aweber-subscribers-count/trunk/aweber-count-shortcode.php

    r551058 r577192  
    4343                        $user_account = $aweber->getAccount( $tgm_aw_options['user_token'], $tgm_aw_options['user_token_secret'] );                     
    4444                        $acc = $user_account->lists->data;
     45                        $list=explode(",",$list);
    4546                        //echo '<pre>'; print_r($acc);
    46                         if(empty($list)){
     47                        //print_r($tgm_aw_options); die;
     48                        if(count($list)<=0){
    4749                            for ($i = 0; $i< count($acc['entries']); $i++)
    4850                            {
    4951                                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                                }
    5159                                //echo $value;
    5260                            }
    5361                        } else {
     62                            //print_r($list);
     63                            $subscriber_count=0; //initially set the subscriber count to 0;
    5464                            for ($i = 0; $i< count($acc['entries']); $i++)
    5565                            {
    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                               
    5876                                //echo $value;
    5977                            }
     78                            return $subscriber_count;
    6079                        }
    6180                       
  • aweber-subscribers-count/trunk/readme.txt

    r551063 r577192  
    1 === Aweber Subscriber Count ===
     1=== Aweber Subscribers Count ===
    22Contributors: alexandreb3
    33Donate link:
    44Tags: aweber, counter, list
    55Requires at least: 3.0
    6 Tested up to: 3.3.2
    7 Stable tag: 1.2
     6Tested up to: 3.4.1
     7Stable tag: 1.5
    88License: GNU General Public License v3.0
    99License URI: http://www.opensource.org/licenses/gpl-license.php
     
    1717The plugin has an option page in order to connect to the aweber account and select the list you want to use.
    1818
    19 The user will use the shortcode [displaycount] to display the subscriber count anywhere in posts or pages.
     19Paste the shortcode with your list name in any post, page or widget: [displaycount list="your_list_name"]
    2020
    21 Advanced Use: If you already know your list name appropiately,paste the shortcode '[displaycount list="your list name"]'.
     21You can combine lists using this shortcode : [displaycount list="your_list_name_1,your_list_name_2"]
     22
     23You can display your list count anywhere in your theme by using <?php echo do_shortcode('[displaycount list="your_list_name"]'); ?>
    2224
    2325== Installation ==
     
    27291. Normal Plugin install.
    28302. 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]'.
     313. Paste shortcode anywhere including any sidebar text widget : [displaycount list="your_list_name"].
    3132
    3233== Frequently Asked Questions ==
     
    3839== Changelog ==
    3940
     41= 1.5 =
     42- Combination of list count
     43- You can now choose to use the subscribed count or the grand total count
     44
    4045= 1.2 =
     46- Release
Note: See TracChangeset for help on using the changeset viewer.