/ Published in: PHP
                    
                                        
Adding E-mail to -  function THEME_signup_user_form
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
/**
* Adding Fields to signup HERE!
*/
function THEME_signup_user_form($node) {
global $user;
// If this function is providing any extra fields at all, the following
// line is required for form form to work -- DO NOT EDIT OR REMOVE.
$form['signup_form_data']['#tree'] = TRUE;
'#type' => 'textfield',
'#title' => t('Name'),
'#size' => 40, '#maxlength' => 64,
'#required' => TRUE,
);
'#type' => 'textfield',
'#title' => t('E-Mail'),
'#size' => 40, '#maxlength' => 64,
'#required' => TRUE,
);
'#type' => 'textfield',
'#title' => t('Phone'),
'#size' => 40, '#maxlength' => 64,
);
// If the user is logged in, fill in their name by default.
if ($user->uid) {
$form['signup_form_data']['Name']['#default_value'] = $user->name;
}
return $form;
}
/**
* Returns the value to use for the user name for anonymous signups.
*
* WARNING: If you implemented your own version of THEME_signup_form_data()
* that changed or removed the custom 'Name' field and your site
* allows anonymous signups, you will need to modify this, too.
*
* This value is used for the %user_name email token for anonymous users, and
* also to identify a particular anonymous signup in various places in the UI.
*
* @param $form_data
* Array of custom signup form values for the current signup.
* @param $email
* E-mail address of the anonymous user who signed up.
* @return
* A string with the proper value for the %user_name email token.
*
* @see THEME_signup_user_form()
*/
function THEME_signup_anonymous_username($form_data, $email) {
// In some cases, the best you can do is to use the anonymous user's
// supplied email address, in which case, you should uncomment this:
//return $email;
// WARNING: This line is only valid if you left the 'Name' field in
// your site's version of THEME_signup_user_form().
return $form_data['Name'];
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                