WordPress.org

Plugin Directory

Changeset 604663


Ignore:
Timestamp:
09/27/12 14:21:42 (19 months ago)
Author:
mordauk
Message:

Uploading version 1.0.5

Location:
mail-chimp-add-on-for-restrict-content-pro
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • mail-chimp-add-on-for-restrict-content-pro/tags/1.0.5/rcp-mailchimp.php

    r519466 r604663  
    44Plugin URL: http://pippinsplugins.com/restrict-content-pro-mailchimp/ 
    55Description: Include a Mail Chimp signup option with your Restrict Content Pro registration form 
    6 Version: 1.0.4 
     6Version: 1.0.5 
    77Author: Pippin Williamson 
    88Author URI: http://pippinsplugins.com 
    99Contributors: Pippin Williamson 
    1010*/ 
    11  
    12 $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    1311 
    1412function rcp_mailchimp_settings_menu() { 
     
    2927function rcp_mailchimp_settings_page() { 
    3028     
    31     global $rcp_mc_options; 
     29    $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    3230         
    3331    ?> 
     
    4543            <?php settings_fields( 'rcp_mailchimp_settings_group' ); ?> 
    4644            <?php $lists = rcp_get_mailchimp_lists(); ?> 
    47             <p> 
    48                 <label for="rcp_mailchimp_settings[mailchimp_api]"><?php _e( 'Mail Chimp API Key', 'rcp' ); ?></label><br/>      
    49                 <input class="regular-text" id="rcp_mailchimp_settings[mailchimp_api]" style="width: 300px;" name="rcp_mailchimp_settings[mailchimp_api]" value="<?php if(isset($rcp_mc_options['mailchimp_api'])) { echo $rcp_mc_options['mailchimp_api']; } ?>"/> 
    50                 <div class="description"><?php _e('Enter your Mail Chimp API key to enable a newsletter signup option with the registration form.', 'rcp'); ?></div> 
    51             </p> 
    52             <p> 
    53                 <select id="rcp_mailchimp_settings[mailchimp_list]" name="rcp_mailchimp_settings[mailchimp_list]"> 
    54                     <?php 
    55                         if($lists) : 
    56                             foreach($lists as $list) : 
    57                                 echo '<option value="' . $list['id'] . '"' . selected($rcp_mc_options['mailchimp_list'], $list['id'], false) . '>' . $list['name'] . '</option>'; 
    58                             endforeach; 
    59                         else : 
    60                     ?> 
    61                     <option value="no list"><?php _e('no lists', 'rcp'); ?></option> 
    62                 <?php endif; ?> 
    63                 </select> 
    64                 <label for="rcp_mailchimp_settings[mailchimp_list]"><?php _e( 'Newsletter List', 'rcp' ); ?></label><br/>        
    65                 <div class="description"><?php _e('Choose the list to subscribe users to', 'rcp'); ?></div> 
    66             </p> 
    67             <p> 
    68                 <label for="rcp_mailchimp_settings[signup_label]"><?php _e( 'Form Label', 'rcp' ); ?></label><br/>       
    69                 <input class="regular-text" id="rcp_mailchimp_settings[signup_label]" style="width: 300px;" name="rcp_mailchimp_settings[signup_label]" value="<?php if(isset($rcp_mc_options['signup_label'])) { echo $rcp_mc_options['signup_label']; } ?>"/> 
    70                 <div class="description"><?php _e('Enter the label to be shown on the "Signup for Newsletter" checkbox', 'rcp'); ?></div> 
    71             </p> 
    72              
     45                 
     46            <table class="form-table"> 
     47 
     48                <tr> 
     49                    <th> 
     50                        <label for="rcp_mailchimp_settings[mailchimp_api]"><?php _e( 'Mail Chimp API Key', 'rcp' ); ?></label> 
     51                    </th> 
     52                    <td> 
     53                        <input class="regular-text" type="text" id="rcp_mailchimp_settings[mailchimp_api]" name="rcp_mailchimp_settings[mailchimp_api]" value="<?php if(isset($rcp_mc_options['mailchimp_api'])) { echo $rcp_mc_options['mailchimp_api']; } ?>"/> 
     54                        <div class="description"><?php _e('Enter your Mail Chimp API key to enable a newsletter signup option with the registration form.', 'rcp'); ?></div> 
     55                    </td> 
     56                </tr> 
     57                <tr> 
     58                    <th> 
     59                        <label for="rcp_mailchimp_settings[mailchimp_list]"><?php _e( 'Newsletter List', 'rcp' ); ?></label> 
     60                    </th> 
     61                    <td> 
     62                        <select id="rcp_mailchimp_settings[mailchimp_list]" name="rcp_mailchimp_settings[mailchimp_list]"> 
     63                            <?php 
     64                                if($lists) : 
     65                                    foreach($lists as $list) : 
     66                                        echo '<option value="' . $list['id'] . '"' . selected($rcp_mc_options['mailchimp_list'], $list['id'], false) . '>' . $list['name'] . '</option>'; 
     67                                    endforeach; 
     68                                else : 
     69                            ?> 
     70                            <option value="no list"><?php _e('no lists', 'rcp'); ?></option> 
     71                        <?php endif; ?> 
     72                        </select> 
     73                        <div class="description"><?php _e('Choose the list to subscribe users to', 'rcp'); ?></div> 
     74                    </td> 
     75                </tr> 
     76                <tr> 
     77                    <th> 
     78                        <label for="rcp_mailchimp_settings[signup_label]"><?php _e( 'Form Label', 'rcp' ); ?></label> 
     79                    </th> 
     80                    <td> 
     81                        <input class="regular-text" type="text" id="rcp_mailchimp_settings[signup_label]" name="rcp_mailchimp_settings[signup_label]" value="<?php if(isset($rcp_mc_options['signup_label'])) { echo $rcp_mc_options['signup_label']; } ?>"/> 
     82                        <div class="description"><?php _e('Enter the label to be shown on the "Signup for Newsletter" checkbox', 'rcp'); ?></div> 
     83                    </td> 
     84                </tr> 
     85            </table> 
    7386            <!-- save the options --> 
    7487            <p class="submit"> 
     
    91104function rcp_get_mailchimp_lists() { 
    92105     
    93     global $rcp_mc_options; 
     106    $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    94107     
    95108    if(strlen(trim($rcp_mc_options['mailchimp_api'])) > 0 ) { 
    96109         
    97110        $lists = array(); 
    98          
    99         require_once('mailchimp/MCAPI.class.php'); 
     111        if( ! class_exists( 'MCAPI' ) ) 
     112            require_once('mailchimp/MCAPI.class.php'); 
    100113        $api = new MCAPI($rcp_mc_options['mailchimp_api']); 
    101114        $list_data = $api->lists(); 
     
    113126// adds an email to the mailchimp subscription list 
    114127function rcp_subscribe_email($email) { 
    115     global $rcp_mc_options; 
     128    $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    116129     
    117130    if(strlen(trim($rcp_mc_options['mailchimp_api'])) > 0 ) { 
    118         require_once('mailchimp/MCAPI.class.php'); 
     131        if( ! class_exists( 'MCAPI' ) ) 
     132            require_once('mailchimp/MCAPI.class.php'); 
    119133        $api = new MCAPI($rcp_mc_options['mailchimp_api']); 
    120134         
     
    129143// displays the mailchimp checkbox 
    130144function rcp_mailchimp_fields() { 
    131     global $rcp_mc_options; 
     145    $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    132146    ob_start();  
    133147        if(strlen(trim($rcp_mc_options['mailchimp_api'])) > 0 ) { ?> 
     
    144158// checks whether a user should be signed up for he mailchimp list 
    145159function rcp_check_for_email_signup($posted, $user_id) { 
    146     if($posted['rcp_mailchimp_signup']) { 
    147         if(is_user_logged_in()) { 
    148             $user_data = get_userdata($user_id); 
    149             $email = $user_data->user_email; 
     160    if( isset( $posted['rcp_mailchimp_signup'] ) ) { 
     161        if( is_user_logged_in() ) { 
     162            $user_data  = get_userdata( $user_id ); 
     163            $email      = $user_data->user_email; 
    150164        } else { 
    151165            $email = $posted['rcp_user_email']; 
    152166        } 
    153         rcp_subscribe_email($email); 
    154         update_user_meta($user_id, 'rcp_subscribed_to_mailchimp', 'yes'); 
     167        rcp_subscribe_email( $email ); 
     168        update_user_meta( $user_id, 'rcp_subscribed_to_mailchimp', 'yes' ); 
    155169    } 
    156170} 
     
    164178 
    165179function rcp_add_mc_table_column_content($user_id) { 
    166     $signed_up = get_user_meta($user_id, 'rcp_subscribed_to_mailchimp', true); 
     180    $signed_up = get_user_meta( $user_id, 'rcp_subscribed_to_mailchimp', true ); 
    167181     
    168     if($signed_up) 
     182    if( $signed_up ) 
    169183        $signed_up = __('yes', 'rcp'); 
    170184    else 
  • mail-chimp-add-on-for-restrict-content-pro/tags/1.0.5/readme.txt

    r519466 r604663  
    33Author: Pippin Williamson 
    44Contributors: mordauk 
    5 Donate link: https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=__LAzNlDH1NR-QahrDPLyvSwLpA2uZ5GilvqzDyLBSRSLnofSWzs_VoBhc4&dispatch=5885d80a13c0db1f8e263663d3faee8dc18bca4c6f47e633fcf61b288f5ebea2 
     5Donate link: http://pippinsplugins.com/support-the-site 
    66Tags: Restrict content, member only, registered, logged in, restricted access, restrict access, limiit access, read-only, read only, mailchimp, mail chimp, newsletter, email list 
    77Requires at least 3.0 
    8 Tested up to 3.3.1 
    9 Stable tag: 1.0.4 
     8Tested up to 3.4.2 
     9Stable tag: 1.0.5 
    1010 
    1111Add Mail Chimp integration to Restrict Content Pro. 
     
    2020 
    2121== Changelog == 
     22 
     23= 1.0.5 = 
     24 
     25* Fixed a class conflict that happened when other Mail Chimp plugins were installed 
     26* Improved settings page to match core WP UI 
    2227 
    2328= 1.0.4 =  
     
    4348== Upgrade Notice == 
    4449 
     50= 1.0.5 = 
     51 
     52* Fixed a class conflict that happened when other Mail Chimp plugins were installed 
     53* Improved settings page to match core WP UI 
     54 
    4555= 1.0.4 =  
    4656 
    4757* Updated the hook used to display the checkbox to work better with other add-ons. 
    4858 
    49  
    5059= 1.0.3 = 
    5160 
  • mail-chimp-add-on-for-restrict-content-pro/trunk/rcp-mailchimp.php

    r519466 r604663  
    44Plugin URL: http://pippinsplugins.com/restrict-content-pro-mailchimp/ 
    55Description: Include a Mail Chimp signup option with your Restrict Content Pro registration form 
    6 Version: 1.0.4 
     6Version: 1.0.5 
    77Author: Pippin Williamson 
    88Author URI: http://pippinsplugins.com 
    99Contributors: Pippin Williamson 
    1010*/ 
    11  
    12 $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    1311 
    1412function rcp_mailchimp_settings_menu() { 
     
    2927function rcp_mailchimp_settings_page() { 
    3028     
    31     global $rcp_mc_options; 
     29    $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    3230         
    3331    ?> 
     
    4543            <?php settings_fields( 'rcp_mailchimp_settings_group' ); ?> 
    4644            <?php $lists = rcp_get_mailchimp_lists(); ?> 
    47             <p> 
    48                 <label for="rcp_mailchimp_settings[mailchimp_api]"><?php _e( 'Mail Chimp API Key', 'rcp' ); ?></label><br/>      
    49                 <input class="regular-text" id="rcp_mailchimp_settings[mailchimp_api]" style="width: 300px;" name="rcp_mailchimp_settings[mailchimp_api]" value="<?php if(isset($rcp_mc_options['mailchimp_api'])) { echo $rcp_mc_options['mailchimp_api']; } ?>"/> 
    50                 <div class="description"><?php _e('Enter your Mail Chimp API key to enable a newsletter signup option with the registration form.', 'rcp'); ?></div> 
    51             </p> 
    52             <p> 
    53                 <select id="rcp_mailchimp_settings[mailchimp_list]" name="rcp_mailchimp_settings[mailchimp_list]"> 
    54                     <?php 
    55                         if($lists) : 
    56                             foreach($lists as $list) : 
    57                                 echo '<option value="' . $list['id'] . '"' . selected($rcp_mc_options['mailchimp_list'], $list['id'], false) . '>' . $list['name'] . '</option>'; 
    58                             endforeach; 
    59                         else : 
    60                     ?> 
    61                     <option value="no list"><?php _e('no lists', 'rcp'); ?></option> 
    62                 <?php endif; ?> 
    63                 </select> 
    64                 <label for="rcp_mailchimp_settings[mailchimp_list]"><?php _e( 'Newsletter List', 'rcp' ); ?></label><br/>        
    65                 <div class="description"><?php _e('Choose the list to subscribe users to', 'rcp'); ?></div> 
    66             </p> 
    67             <p> 
    68                 <label for="rcp_mailchimp_settings[signup_label]"><?php _e( 'Form Label', 'rcp' ); ?></label><br/>       
    69                 <input class="regular-text" id="rcp_mailchimp_settings[signup_label]" style="width: 300px;" name="rcp_mailchimp_settings[signup_label]" value="<?php if(isset($rcp_mc_options['signup_label'])) { echo $rcp_mc_options['signup_label']; } ?>"/> 
    70                 <div class="description"><?php _e('Enter the label to be shown on the "Signup for Newsletter" checkbox', 'rcp'); ?></div> 
    71             </p> 
    72              
     45                 
     46            <table class="form-table"> 
     47 
     48                <tr> 
     49                    <th> 
     50                        <label for="rcp_mailchimp_settings[mailchimp_api]"><?php _e( 'Mail Chimp API Key', 'rcp' ); ?></label> 
     51                    </th> 
     52                    <td> 
     53                        <input class="regular-text" type="text" id="rcp_mailchimp_settings[mailchimp_api]" name="rcp_mailchimp_settings[mailchimp_api]" value="<?php if(isset($rcp_mc_options['mailchimp_api'])) { echo $rcp_mc_options['mailchimp_api']; } ?>"/> 
     54                        <div class="description"><?php _e('Enter your Mail Chimp API key to enable a newsletter signup option with the registration form.', 'rcp'); ?></div> 
     55                    </td> 
     56                </tr> 
     57                <tr> 
     58                    <th> 
     59                        <label for="rcp_mailchimp_settings[mailchimp_list]"><?php _e( 'Newsletter List', 'rcp' ); ?></label> 
     60                    </th> 
     61                    <td> 
     62                        <select id="rcp_mailchimp_settings[mailchimp_list]" name="rcp_mailchimp_settings[mailchimp_list]"> 
     63                            <?php 
     64                                if($lists) : 
     65                                    foreach($lists as $list) : 
     66                                        echo '<option value="' . $list['id'] . '"' . selected($rcp_mc_options['mailchimp_list'], $list['id'], false) . '>' . $list['name'] . '</option>'; 
     67                                    endforeach; 
     68                                else : 
     69                            ?> 
     70                            <option value="no list"><?php _e('no lists', 'rcp'); ?></option> 
     71                        <?php endif; ?> 
     72                        </select> 
     73                        <div class="description"><?php _e('Choose the list to subscribe users to', 'rcp'); ?></div> 
     74                    </td> 
     75                </tr> 
     76                <tr> 
     77                    <th> 
     78                        <label for="rcp_mailchimp_settings[signup_label]"><?php _e( 'Form Label', 'rcp' ); ?></label> 
     79                    </th> 
     80                    <td> 
     81                        <input class="regular-text" type="text" id="rcp_mailchimp_settings[signup_label]" name="rcp_mailchimp_settings[signup_label]" value="<?php if(isset($rcp_mc_options['signup_label'])) { echo $rcp_mc_options['signup_label']; } ?>"/> 
     82                        <div class="description"><?php _e('Enter the label to be shown on the "Signup for Newsletter" checkbox', 'rcp'); ?></div> 
     83                    </td> 
     84                </tr> 
     85            </table> 
    7386            <!-- save the options --> 
    7487            <p class="submit"> 
     
    91104function rcp_get_mailchimp_lists() { 
    92105     
    93     global $rcp_mc_options; 
     106    $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    94107     
    95108    if(strlen(trim($rcp_mc_options['mailchimp_api'])) > 0 ) { 
    96109         
    97110        $lists = array(); 
    98          
    99         require_once('mailchimp/MCAPI.class.php'); 
     111        if( ! class_exists( 'MCAPI' ) ) 
     112            require_once('mailchimp/MCAPI.class.php'); 
    100113        $api = new MCAPI($rcp_mc_options['mailchimp_api']); 
    101114        $list_data = $api->lists(); 
     
    113126// adds an email to the mailchimp subscription list 
    114127function rcp_subscribe_email($email) { 
    115     global $rcp_mc_options; 
     128    $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    116129     
    117130    if(strlen(trim($rcp_mc_options['mailchimp_api'])) > 0 ) { 
    118         require_once('mailchimp/MCAPI.class.php'); 
     131        if( ! class_exists( 'MCAPI' ) ) 
     132            require_once('mailchimp/MCAPI.class.php'); 
    119133        $api = new MCAPI($rcp_mc_options['mailchimp_api']); 
    120134         
     
    129143// displays the mailchimp checkbox 
    130144function rcp_mailchimp_fields() { 
    131     global $rcp_mc_options; 
     145    $rcp_mc_options = get_option('rcp_mailchimp_settings'); 
    132146    ob_start();  
    133147        if(strlen(trim($rcp_mc_options['mailchimp_api'])) > 0 ) { ?> 
     
    144158// checks whether a user should be signed up for he mailchimp list 
    145159function rcp_check_for_email_signup($posted, $user_id) { 
    146     if($posted['rcp_mailchimp_signup']) { 
    147         if(is_user_logged_in()) { 
    148             $user_data = get_userdata($user_id); 
    149             $email = $user_data->user_email; 
     160    if( isset( $posted['rcp_mailchimp_signup'] ) ) { 
     161        if( is_user_logged_in() ) { 
     162            $user_data  = get_userdata( $user_id ); 
     163            $email      = $user_data->user_email; 
    150164        } else { 
    151165            $email = $posted['rcp_user_email']; 
    152166        } 
    153         rcp_subscribe_email($email); 
    154         update_user_meta($user_id, 'rcp_subscribed_to_mailchimp', 'yes'); 
     167        rcp_subscribe_email( $email ); 
     168        update_user_meta( $user_id, 'rcp_subscribed_to_mailchimp', 'yes' ); 
    155169    } 
    156170} 
     
    164178 
    165179function rcp_add_mc_table_column_content($user_id) { 
    166     $signed_up = get_user_meta($user_id, 'rcp_subscribed_to_mailchimp', true); 
     180    $signed_up = get_user_meta( $user_id, 'rcp_subscribed_to_mailchimp', true ); 
    167181     
    168     if($signed_up) 
     182    if( $signed_up ) 
    169183        $signed_up = __('yes', 'rcp'); 
    170184    else 
  • mail-chimp-add-on-for-restrict-content-pro/trunk/readme.txt

    r519466 r604663  
    33Author: Pippin Williamson 
    44Contributors: mordauk 
    5 Donate link: https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=__LAzNlDH1NR-QahrDPLyvSwLpA2uZ5GilvqzDyLBSRSLnofSWzs_VoBhc4&dispatch=5885d80a13c0db1f8e263663d3faee8dc18bca4c6f47e633fcf61b288f5ebea2 
     5Donate link: http://pippinsplugins.com/support-the-site 
    66Tags: Restrict content, member only, registered, logged in, restricted access, restrict access, limiit access, read-only, read only, mailchimp, mail chimp, newsletter, email list 
    77Requires at least 3.0 
    8 Tested up to 3.3.1 
    9 Stable tag: 1.0.4 
     8Tested up to 3.4.2 
     9Stable tag: 1.0.5 
    1010 
    1111Add Mail Chimp integration to Restrict Content Pro. 
     
    2020 
    2121== Changelog == 
     22 
     23= 1.0.5 = 
     24 
     25* Fixed a class conflict that happened when other Mail Chimp plugins were installed 
     26* Improved settings page to match core WP UI 
    2227 
    2328= 1.0.4 =  
     
    4348== Upgrade Notice == 
    4449 
     50= 1.0.5 = 
     51 
     52* Fixed a class conflict that happened when other Mail Chimp plugins were installed 
     53* Improved settings page to match core WP UI 
     54 
    4555= 1.0.4 =  
    4656 
    4757* Updated the hook used to display the checkbox to work better with other add-ons. 
    4858 
    49  
    5059= 1.0.3 = 
    5160 
Note: See TracChangeset for help on using the changeset viewer.