News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Adding D.O.B to registration form

Started by kartheekb, June 09, 2010, 08:13:36 PM

Previous topic - Next topic

kartheekb

hi,
i want to add a Date of Birth Column in the registration form.. And column that must be usefull to show the birthday in the statasics when ever there birthday comes
www.jntuhub.com/forum (check out my forums)

Arantor


kartheekb

so can i ask this Question  in smf 2.0 support
www.jntuhub.com/forum (check out my forums)

Arantor

You're in the right board. Just it might help if you provide a few more details, you know like SMF version, theme, that kind of thing -- like the guide I wrote asks for.

kartheekb

ok

i am using SMF 2.0 RC3
Theme: outlook

i need a date of birth colum in registration forum.
which must be automatically birthdays will be shown in broad when there birthday arives
www.jntuhub.com/forum (check out my forums)

Arantor

What, because your users are too lazy to enter it into their profile later?

So, are you wanting it to be required? Checked for sanity? Or just optional extra information?

kartheekb

i need to display the "today birthday" information of all the members..

no one will go to profiles and edit that info...

if we provide that column . Mostly all members will fill the D.O.B

www.jntuhub.com/forum (check out my forums)

Arantor

So, again, is it required? Are you planning to require all three fields (day/month, or day/month/year)? Are you going to check whether the year makes sense?

What happens if users don't enter it?

kartheekb

if they dont enter..they birthdays will not appear in the board ?

so at that time they will ask me.. today is my birthday also..why my birthday is not appearing in the board.

then i have to tell fill the profile first...

so for how many members can i tell like this????
www.jntuhub.com/forum (check out my forums)

Arantor

I'm not asking you what it does now. I'm asking you how you want it to behave.

*shrug* Since I can't apparently master asking a simple quesion, I'd better stop now.

kartheekb

may be a little confusions between us..

can we have option to place a column of dob in registration ? which is available in profile now

and i want to show it in here..see screen shot.
www.jntuhub.com/forum (check out my forums)

hvyhitter

There is a thread that has a small piece of code in it that you add to the register.english file or something like that..

it answers exactly what you are looking for

http://www.simplemachines.org/community/index.php?topic=351983.0

Found it.. had to use google.. entered "smf birthday on registration" Second post.

second page
Quote
sorry for late response foks .... was bit ill

so here u go

/themes/default/Register.template.php

Find:
Code: [Select]
// If OpenID is enabled, give the user a choice between password and OpenID.

Add Before:
Code: [Select]
//Show Bday on reg
   
   echo '   
   <dl class="register_form">
      <dt>
      <strong>', $txt['dob'], '</strong><br />
      <span class="smalltext">', $txt['dob_year'], ' - ', $txt['dob_month'], ' - ', $txt['dob_day'], '</span>
      </dt>
      <dd>
      <input type="text" name="bday3" size="4" maxlength="4" value="', (!empty($context['member']['birth_date']) ? $context['member']['birth_date']['year'] : ''), '" /> -
      <input type="text" name="bday1" size="2" maxlength="2" value="', (!empty($context['member']['birth_date']) ? $context['member']['birth_date']['month'] : ''), '" /> -
      <input type="text" name="bday2" size="2" maxlength="2" value="', (!empty($context['member']['birth_date']) ? $context['member']['birth_date']['day'] : ''), '" />
      </dd>
   </dl>';

plz keep the original file as back up ;)


hvyhitter

did that to RC3 yesterday... works like a CHARM.

my users are lazy too.

funny.. if you make it an over 18 forum and people arent required to enter their age to enter the place. I always thought that was a little.. backwards?

anyhow.. that does it..

and for extra points.. I recommend adding reCAPTCHA.. it is totally worth it.. stops spammers cold.. and looks uber pro.

Advertisement: