Plugin Directory

Changeset 973415


Ignore:
Timestamp:
08/26/2014 04:34:49 PM (11 years ago)
Author:
buildcreate
Message:

Misc multisite and buddypress fixes

Location:
agreeable/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • agreeable/trunk/agreeable.php

    r970082 r973415  
    44Plugin URI: http://wordpress.org/extend/plugins/agreeable
    55Description: Add a required "Agree to terms" checkbox to login and/or register forms.  Based on the I-Agree plugin by Michael Stursberg.
    6 Version: 1.3.2
     6Version: 1.3.3
    77Author: kraftpress
    88Author URI: http://kraftpress.it
     
    3030
    3131        /* Initialize the plugin */
    32         add_action('init', array($this, 'ag_language_init'));
     32        add_action('init', array($this, 'init'));
    3333        add_action('admin_enqueue_scripts', array($this, 'ag_admin'));
    3434        add_action('wp_enqueue_scripts', array($this, 'ag_front'));
     
    5858        add_action('tml_register_form', array($this, 'ag_register_terms_accept'), 10, 3);
    5959        add_action('bp_after_login_widget_loggedout', array($this, 'ag_widget_terms_accept'));
    60 
    61         if (is_multisite()) {
    62             add_action( 'signup_extra_fields', 'ag_register_terms_accept', 10, 3);
    63             add_action( 'signup_blogform', 'ag_register_terms_accept', 10, 3);
    64         }
    6560
    6661        $this->options = array(
     
    9489    }
    9590
    96     function ag_language_init() {
     91    function init() {
    9792        // Localization
    9893        load_plugin_textdomain('agreeable', false, basename( dirname( __FILE__ ) ) . '/languages' );
     94       
     95        if (is_multisite()) {
     96            add_action( 'signup_extra_fields', array($this, 'ag_register_terms_accept'), 10, 3);
     97            add_action( 'signup_blogform', array($this, 'ag_register_terms_accept'), 10, 3);
     98        }
    9999    }
    100100
    101101    function ag_admin() {
     102   
    102103        /* Plugin Stylesheet */
    103104        wp_enqueue_style( 'agreeable-css', plugins_url('css/admin.css', __FILE__), '', '0.3.4', 'screen');
     105       
    104106    }
    105107
    106108    function ag_front() {
     109   
    107110        /* Only load lightbox code on the frontend, where we need it */
    108111        if ( $this->is_login_page() ) {
    109112            wp_enqueue_script('jquery');
    110113        }
     114       
    111115        wp_enqueue_script( 'magnific', plugins_url('js/magnific.js', __FILE__),'', '', true);
    112116        wp_enqueue_script( 'agreeable-js', plugins_url('js/agreeable.js', __FILE__), '', '', true);
    113117        wp_enqueue_style( 'magnific', plugins_url('css/magnific.css', __FILE__));
    114118        wp_enqueue_style( 'agreeable-css', plugins_url('css/front.css', __FILE__));
     119       
    115120    }
    116121
     
    160165
    161166                if(is_multisite()) {
    162 
     167                   
     168                    $result = $user;
    163169                    $result['errors'] = $errors;
    164                     $result['errors']->add('ag_did_not_accept', $this->options['fail_text']);
    165 
     170                   
    166171                    return $result;
    167172
     
    268273        $errors = new WP_Error();
    269274
    270         if(isset($_SESSION['ag_errors']) && $errors->get_error_message( 'ag_did_not_accept' ) != '' ) {
     275        if(isset($_SESSION['ag_errors']) && $errors->get_error_message( 'ag_did_not_accept' ) == '' ) {
    271276
    272277            $error = $_SESSION['ag_errors'];
     
    323328        if($this->options['register'] == 1) {
    324329            $this->ag_display_terms_form('register', $errors);
    325         }
    326 
    327         echo '<script>';
    328         echo '
    329                 jQuery(document).ready(function($){
    330                     if($("#theme-my-login")) {
    331                         $("#theme-my-login #terms-accept").insertBefore("#theme-my-login .submit");
    332                     }
    333                 });
    334             ';
    335         echo '</script>';
    336 
     330           
     331            echo '<script>';
     332            echo '
     333                    jQuery(document).ready(function($){
     334                        if($("#theme-my-login")) {
     335                            $("#theme-my-login #terms-accept").insertBefore("#theme-my-login .submit");
     336                        }
     337                    });
     338                ';
     339            echo '</script>';
     340           
     341        }
     342        return;
    337343    }
    338344
  • agreeable/trunk/readme.txt

    r969031 r973415  
    99
    1010== Description ==
    11 Add an "agree to terms" check box to your login and/or registration pages, requiring users to agree prior to logging in or registering. Tested with BuddyPress.  Based on the I-Agree plugin by thesturs.
     11Add an "agree to terms" check box to your login, registration, or comment forms, requiring users to agree. Tested with BuddyPress and Multisite.  Based on the I-Agree plugin by thesturs.
    1212
    1313Use the form in the plugin settings page to contact us with feature requests, comments, or concerns.
    1414
    15 = New! =
    16 * Lightbox is now RESPONSIVE!  And prettier :)
    17 * Customize your lightbox background and text colors
    18 * Disable the lightbox if you want
    19 * Add the checkbox to your comment forms now too!
    20 
    2115= Features =
    2216* Select your terms page from a dropdown
    23 * Terms open in a lightbox or new tab
     17* Terms open in a responsive lightbox or new tab
    2418* Tested with WP, BuddyPress, and bbPress login widgets
    2519* Customizable text and error message
     20
     21= Extensions =
     22* [Agreeable Records] (http://kraftpress.it/downloads/agreeable-records/, "Agreeable Records Premium Plugin Extension") allows you to track user agreement by IP and username each time they log in.
    2623
    2724= Translations =
     
    4138
    4239== Changelog ==
     40
     41= 1.3.3 =
     42* Misc Multisite and BuddyPress bug fixes
    4343
    4444= 1.3 =
Note: See TracChangeset for help on using the changeset viewer.