WordPress.org

Plugin Directory

Changeset 611707


Ignore:
Timestamp:
10/12/12 20:37:32 (19 months ago)
Author:
Ipstenu
Message:

Trunk is testing version 1.1 - DO NOT USE unless you are brave.

Location:
join-my-multisite
Files:
7 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • join-my-multisite/trunk/admin/defines.php

    r609291 r611707  
    2626defined('PLUGIN_DIR') || define('PLUGIN_DIR', realpath(dirname(__FILE__) . '/..')); 
    2727 
    28 define( 'PLUGIN_VERSION', '1.0' );  
    29  
    3028/*  
    3129    Widgets 
     
    3432// Registers our widget. 
    3533function jmm_load_add_user_widgets() { 
    36     include_once( PLUGIN_DIR . '/widget.php'); 
     34    include_once( PLUGIN_DIR . '/lib/widget.php'); 
    3735} 
    3836 
     
    4240    if ($jmm_options['type'] == 2) { add_action( 'widgets_init', 'jmm_load_add_user_widgets' ); } 
    4341 
     42    // Shortcode 
     43    if ( get_option('users_can_register') == 1 && !is_null($jmm_options['perpage']) && $jmm_options['perpage'] != "XXXXXX"  ) { 
     44        include_once( PLUGIN_DIR . '/lib/shortcode.php'); 
     45    } 
    4446 
    4547// The Help Screen 
     
    5557add_action('jmm_joinsite', array('JMM', 'join_site')); 
    5658add_action('init', array('JMM', 'init')); 
    57  
    58 // WP-CLI - Maybe... 
    59  
    60 //if ( defined('WP_CLI') && WP_CLI ) { 
    61 //  include( PLUGIN_DIR . '/lib/wp-cli.php' ); 
    62 //} 
  • join-my-multisite/trunk/admin/help.php

    r609291 r611707  
    4545         
    4646        '<p><a href="http://codex.wordpress.org/Roles_and_Capabilities">' . __('WordPress Roles & Capabilities', 'jmm' ) . '</a></p>' . 
    47         '<p><a href="http://wordpress.org/extend/plugins/multisite-user-management/">' . __('Plugin: Multisite User Management', 'jmm' ) . '</a></p>' . 
    48         '<p><a href="http://example.com/">' . __('Link Three', 'jmm' ) . '</a></p>' 
     47        '<p><a href="http://wordpress.org/extend/plugins/multisite-user-management/">' . __('Plugin: Multisite User Management', 'jmm' ) . '</a></p>' 
    4948        ); 
    5049 
    5150    // Options 
    5251    $screen->add_help_tab( array( 
    53         'id'      => 'jmm-menu-options', 
    54         'title'   => __('Options', 'helfjmm'), 
     52        'id'      => 'jmm-menu-membership-options', 
     53        'title'   => __('Membership', 'helfjmm'), 
    5554        'content' => 
    5655        '<h3>' . __('Membership Options', 'helfjmm') .'</h3>' . 
     
    6059              <li><strong>'. __('None: ', 'helfjmm') . '</strong>' . __('Don\'t allow new users to add themselves this site, add them manually.', 'helfjmm') . '</li> 
    6160        </ul>' . 
    62         '<p>' . __( 'If don\'t want anything to change, then you can leave this plugin alone (i.e. on "None").', 'helfjmm' ) . '</p>' . 
     61        '<p>' . __( 'If don\'t want anything to change, then you can leave this plugin alone (i.e. on "None").', 'helfjmm' ) . '</p>'  
     62        )); 
     63         
     64    // Options 
     65    $screen->add_help_tab( array( 
     66        'id'      => 'jmm-menu-role-options', 
     67        'title'   => __('New User Role', 'helfjmm'), 
     68        'content' => 
    6369        '<h3>' . __('New User Default Role Options', 'helfjmm') .'</h3>' . 
    6470        '<p>' . __( 'This is a simple drop-down for what role new users should have. It defaults to Subscriber.', 'helfjmm' ) . '</p>'  
     71      )); 
     72 
     73    // Options 
     74    $screen->add_help_tab( array( 
     75        'id'      => 'jmm-menu-shortcode-options', 
     76        'title'   => __('Shortcode', 'helfjmm'), 
     77        'content' => 
     78        '<h3>' . __('Shortcode Options', 'helfjmm') .'</h3>' . 
     79        '<p>' . __( 'Check the box to turn allow for per-site registration. This will only be an option if your network has enabled registration. You then select a page from the drop-down list of pages, and on the page use the following shortcode to display your registration form.', 'helfjmm' ) . '</p>'  . 
     80        '<code>[join-my-multisite]</code>' 
    6581      )); 
    6682} 
  • join-my-multisite/trunk/admin/settings.php

    r609291 r611707  
    4343                    <tr valign="top"> 
    4444                        <th scope="row"><?php _e('Membership:', 'helfjmm'); ?></th> 
    45                         <td><input type="radio" name="helfjmm_options[type]" value="1" <?php if ($jmm_options['type'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('Auto:', 'helfjmm'); ?></strong> <?php _e('Auto-Add signed in users to this site when they visit.', 'helfjmm'); ?></label><br /> 
    46                             <input type="radio" name="helfjmm_options[type]" value="2" <?php if ($jmm_options['type'] == 2) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('Manual:', 'helfjmm'); ?></strong> <?php _e('Allow signed in users to join via a widget.', 'helfjmm'); ?></label><br /> 
    47                             <input type="radio" name="helfjmm_options[type]" value="3" <?php if ($jmm_options['type'] == 3) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('None:', 'helfjmm'); ?></strong> <?php _e('Don\'t allow new users to add themselves this site, add them manually.', 'helfjmm'); ?></label> 
     45                        <td><p> 
     46                            <input type="radio" name="helfjmm_options[type]" value="1" <?php if ($jmm_options['type'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('Automatic', 'helfjmm'); ?></strong> </label><br /> 
     47                            <input type="radio" name="helfjmm_options[type]" value="2" <?php if ($jmm_options['type'] == 2) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('Manual', 'helfjmm'); ?></strong> </label><br /> 
     48                            <input type="radio" name="helfjmm_options[type]" value="3" <?php if ($jmm_options['type'] == 3) echo 'checked="checked"'; ?>> <label for="jmm-type"><strong><?php _e('None', 'helfjmm'); ?></strong></label> 
     49                        </p></td> 
     50                        <td><p class="description"> 
     51                        <?php _e('Auto-Add signed in users to this site when they visit.', 'helfjmm'); ?><br /> 
     52                        <?php _e('Allow signed in users to join via a widget.', 'helfjmm'); ?><br /> 
     53                        <?php _e('Don\'t allow new users to add themselves this site, add them manually.', 'helfjmm'); ?> 
     54                        </p></td> 
     55                    </tr> 
     56                     
     57                    <?php 
     58                    if ( get_option('users_can_register') == 1 ): 
     59                    ?> 
     60                     
     61                    <tr valign="top"> 
     62                        <th scope="row"><?php _e('Registration:', 'helfjmm'); ?></th> 
     63                        <td><p> 
     64                            <input type="checkbox" name="helfjmm_options[persite]" value="1" <?php if ($jmm_options['persite'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-persite"><?php _e('Per-Site Registration.', 'helfjmm'); ?></label> 
     65                        </p></td> 
     66                        <td><p class="description"><?php _e('Check this box if you want to use a shortcode to customize per-site registration. If unchecked, registrations will be sent to the network registration page.', 'helfjmm'); ?></p></td> 
     67                    </tr> 
     68                    <?php if ($jmm_options['persite'] == 1) {  
     69                            $all_pages = get_pages(); 
     70                    ?>    
     71                    <tr valign="top"> 
     72                        <th scope="row"></th> 
     73                        <td> 
     74                        <p><select name="helfjmm_options[perpage]" id='jmm_options[perpage]'> 
     75                            <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option> 
     76                            <?php if ( current_user_can( 'create_posts', 'page' ) ) : ?> 
     77                            <option value="new" id="new-page"><?php _e( '&mdash; Add new page &mdash;' ); ?></option> 
     78                            <?php endif; ?> 
     79                            <?php echo walk_page_dropdown_tree( $all_pages, 0, array( 'depth' => 1,'selected' => $jmm_options['perpage'] ) ); ?> 
     80                        </select></p> 
     81                        </td> 
     82                         
     83                        <td><p class="description"><?php _e('Non-logged in users will be redirected to the perpage you select from the dropdowns. Only top-level pages may be used. Use the following shortcode to display the login form:', 'helfjmm'); ?><br /> 
     84                            <code>[join-my-multisite]</code> 
    4885                        </td> 
    4986                    </tr> 
    50      
    51                 <tr> 
     87                    <?php } ?> 
     88                     
     89                    <?php  
     90                     
     91                    endif; // End check for if registration is on for the network. 
     92                     
     93                    ?> 
     94                     
     95                    <tr> 
    5296                        <th scope="row"><?php _e('New User Default Role:', 'helfjmm'); ?></th> 
    5397                        <td> 
  • join-my-multisite/trunk/joinmymultisite.php

    r609291 r611707  
    3838            add_action('admin_notices', array('JMM','updateMessage')); 
    3939            if ( $jmm_options['role'] != get_option( 'default_user_role' ) ) 
    40                 { update_option(default_user_role, $jmm_options['role']); } 
     40                { update_option( 'default_user_role', $jmm_options['role']); } 
    4141        } 
    4242         
     
    4444            $jmm_options['type'] = '3'; // 3 = keep things the same 
    4545            $jmm_options['role'] = 'subscriber'; // default to the lowest role possible 
    46             update_option('jmm_options', $jmm_options); 
     46            $jmm_options['persite'] = '0'; // 0 = No 
     47            $jmm_options['perpage'] = 'XXXXXX'; // blank 
     48            update_option('helfjmm_options', $jmm_options); 
    4749        } 
    4850    } 
  • join-my-multisite/trunk/readme.txt

    r609291 r611707  
    77Donate link: https://www.wepay.com/donations/halfelf-wp 
    88 
    9 Allow site admins to automatically add existing network users to their site, or let users decide at the click a button. 
     9Allow site admins to automatically add existing users to their site, or let users decide at the click a button. 
    1010 
    1111== Description == 
     
    2121It's really that simple!  
    2222 
    23 If they decide to auto-add, then any time a logged in user visits a site, they will be magically added to that site. 
     23If they decide to auto-add, then any time a logged in user visits a site, they will be magically added to that site. If they decide to use a 'Join This Site' button, then they can customize the button message text for users who are logged in but not members, not logged in, or already members. Don't worry, if you have registation turned off, they won't see the 'register' button. 
    2424 
    25 If they decide to use a 'Join This Site' button, then they can customize the button message text for users who are logged in but not members, not logged in, or already members. Don't worry, if you have registation turned off, they won't see the 'register' button. 
     25In addition, if you have registration turned on, each site can chose to use 'Per Site Registration,' which will allow them to create a page on their site just for registrations and signups. To display the signup code, just put <code>[join-my-multisite]</code> on the page. 
    2626 
    2727* [Plugin Site](http://halfelf.org/plugins/sitewide-comment-control/) 
     
    3030==Changelog== 
    3131 
     32= 1.1 = 
     3312 October, 2012 by Ipstenu 
     34 
     35* Added in a per-site registration page option. 
     36 
    3237=  1.0 = 
    33 * 07 October, 2012 by Ipstenu 
     3807 October, 2012 by Ipstenu 
     39 
    3440* First completed version. 
    3541 
     
    42481. Menu 
    43491. Widget 
     501. Sample per-site registration front end 
    4451 
    4552== Upgrade Notice == 
     
    5663 
    5764By default it will pick up whatever style your theme has, so if it styles buttons, you'll automatically match. If you want more, the css is `input#join-site.button` to just play with the button. 
     65 
     66= How do I style the per-site registration page? = 
     67 
     68In your theme's CSS. This is basically the default WordPress signup page, just done in short-code form, so it will default to use your site's CSS anyway. 
Note: See TracChangeset for help on using the changeset viewer.