altering registration error

Started by djpaddystudio7, June 17, 2006, 02:06:06 PM

Previous topic - Next topic

djpaddystudio7

well looking at few older topics i tried to add the birthdate to my registeration page
i edited the register.php & register.template.php
edited parts shown in red

register.php

   // If you're an admin, you're special ;).
if (!$user_info['is_admin'])
{

if (!isset($_POST['options']['birthdate']) || $_POST['options']['birthdate'] == '')
fatal_error('Please enter your birthdate to register.', false);

// Set the options needed for registration.
$regOptions = array(
'interface' => 'guest',
'username' => $_POST['user'],
'email' => $_POST['email'],
                'birthdate' => $_POST['birthdate'],
'password' => $_POST['passwrd1'],
'password_check' => $_POST['passwrd2'],
'check_reserved_name' => true,
'check_password_strength' => true,
'check_email_ban' => true,
'send_welcome_email' => !empty($modSettings['send_welcomeEmail']),
'require' => !empty($modSettings['coppaAge']) && !isset($_POST['skip_coppa']) ? 'coppa' : (empty($modSettings['registration_method']) ? 'nothing' : ($modSettings['registration_method'] == 1 ? 'activation' : 'approval')),
'extra_register_vars' => array(),
'theme_vars' => array(),
);



register.template.php
<td width="40%">
<b>', $txt[98], ':</b>
<div class="smalltext">', $txt[520], '</div>
</td>
<td>
<input type="text" name="user" size="20" tabindex="', $context['tabindex']++, '" maxlength="25" />
</td>
</tr><tr>
<td width="40%">
<b>', $txt[563], ':</b>
<div class="smalltext">', $txt[566], ' - ', $txt[564], ' - ', $txt[565], '</div>
</td>
<td class="smalltext">
<input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" /> -
<input type="text" name="bday1" size="2" maxlength="2" value="', $context['member']['birth_date']['month'], '" /> -
<input type="text" name="bday2" size="2" maxlength="2" value="', $context['member']['birth_date']['day'], '" />
</td>
</tr><tr>
<td width="40%">
<b>', $txt[69], ':</b>
<div class="smalltext">', $txt[679], '</div>
</td>
<td>


also in the profile.php i made birthdate location and gender mandatory


     

        if (isset($_POST['location']) && empty($_POST['location']))
fatal_error('Please specify a location.', false);
        if (isset($_POST['birthdate']) && empty($_POST['birthdate']))
fatal_error('Please specify a birthdate.', false);
        if (isset($_POST['gender']) && empty($_POST['gender']))
fatal_error('Please specify a gender.', false);

// Fix the spaces in messenger screennames...
$fix_spaces = array('MSN', 'AIM', 'YIM');


but there is absolutely no change in the registeration page

can some one tell me how to add birthdate in registration and make it a required field ???




update now ity shows
Parse error: parse error, unexpected $ in /home/masttinf/public_html/forum/Sources/Register.php on line 507
whereas when i checked the only thing i saw on line 507 was     

?>

well so what do ya think



Advertisement: