Changeset 925

Show
Ignore:
Timestamp:
03/20/07 18:20:36 (2 years ago)
Author:
donncha
Message:

Minor html changes
added signup_extra_fields action
remember "signup for" status
$blog_id shouldn't be used globally as a string

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-signup.php

    r867 r925  
    7979</tr> 
    8080<?php 
    81 do_action('signup_blogform', $errors ); 
     81do_action('signup_blogform', $errors); 
    8282} 
    8383 
     
    116116                print '<tr>'; 
    117117        } 
    118 ?><th valign="top"><?php _e('Email&nbsp;Address:') ?></th><td><?php 
     118?><th valign="top"><?php _e('Email&nbsp;Address:') ?></th><td valign="top"><?php 
    119119 
    120120        if ( $errmsg = $errors->get_error_message('user_email') ) { 
     
    127127        if ( $errmsg = $errors->get_error_message('generic') ) 
    128128                print '<tr class="error"> <th colspan="2">'.$errmsg.'</th> </tr>'; 
     129        do_action( 'signup_extra_fields' ); 
    129130} 
    130131 
     
    213214        if ( ! is_wp_error($errors) ) 
    214215                $errors = new WP_Error(); 
     216        if( isset( $_POST[ 'signup_for' ] ) ) { 
     217                $signup[ wp_specialchars( $_POST[ 'signup_for' ] ) ] = 'checked'; 
     218        } else { 
     219                $signup[ 'blog' ] = 'checked'; 
     220        } 
    215221 
    216222        // allow definition of default variables 
     
    225231<input type="hidden" name="stage" value="validate-user-signup"> 
    226232<?php do_action( "signup_hidden_fields" ); ?> 
    227 <table border="0" width="100%" cellpadding="9"
     233<table border="0" width="100%" cellpadding="9" cellspacing="4"
    228234<?php show_user_form($user_name, $user_email, $errors); ?> 
    229235<th scope="row"  valign="top">&nbsp;</th> 
    230236<td> 
    231237<p> 
    232 <input id="signupblog" type="radio" name="signup_for" value="blog" checked="checked" /> 
     238<input id="signupblog" type="radio" name="signup_for" value="blog" <?php echo $signup[ 'blog' ] ?> /> 
    233239<label for="signupblog"><?php _e('Gimme a blog!') ?></label> 
    234240<br /> 
    235 <input id="signupuser" type="radio" name="signup_for" value="user" /> 
     241<input id="signupuser" type="radio" name="signup_for" value="user" <?php echo $signup[ 'user' ] ?> /> 
    236242<label for="signupuser"><?php _e('Just a username, please.') ?></label> 
    237243</p> 
     
    262268        } 
    263269 
    264         wpmu_signup_user($user_name, $user_email); 
     270        wpmu_signup_user($user_name, $user_email, apply_filters( "add_signup_meta", array() ) ); 
    265271 
    266272        confirm_user_signup($user_name, $user_email); 
     
    349355        die(); 
    350356} 
    351 $blog_id = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; 
     357$newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; 
    352358if( $_POST['blog_public'] != 1 ) 
    353359        $_POST['blog_public'] = 0; 
     
    367373                do_action( "preprocess_signup_form" ); // populate the form from invites, elsewhere? 
    368374                if ( is_user_logged_in() ) 
    369                         signup_another_blog($blog_id); 
     375                        signup_another_blog($newblogname); 
    370376                else 
    371                         signup_user( $blog_id, $user_email ); 
    372  
    373                 if ($blog_id) { 
     377                        signup_user( $newblogname, $user_email ); 
     378 
     379                if ($newblogname) { 
    374380                        if( constant( "VHOST" ) == 'no' ) 
    375                                 $newblog = 'http://' . $current_site->domain . $current_site->path . $blog_id . '/'; 
     381                                $newblog = 'http://' . $current_site->domain . $current_site->path . $newblogname . '/'; 
    376382                        else 
    377                                 $newblog = 'http://' . $blog_id . '.' . $current_site->domain . $current_site->path; 
     383                                $newblog = 'http://' . $newblogname . '.' . $current_site->domain . $current_site->path; 
    378384                        printf(__("<p><em>The blog you were looking for, <strong>%s</strong> doesn't exist but you can create it now!</em></p>"), $newblog ); 
    379385                }