• Welcome to Simple Machines Community Forum. Please login or sign up.

Making Gender and Birthday required for register

Started by Atoa, December 04, 2009, 06:54:18 AM

Previous topic - Next topic

Joker™

sorry for late response foks .... was bit ill

so here u go

/themes/default/Register.template.php

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


Add Before:
//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 ;)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Afro

Its good but people might not like the idea of adding the birthday there.

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Afro

then you hat to write ''optional'' below it Just to indicate that. that would be nice

Joker™

February 06, 2010, 01:49:12 PM #24 Last Edit: February 06, 2010, 02:01:14 PM by sid2varun
DOne ... thanx for the suggestion :)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

ForumMustang.com

November 27, 2010, 10:33:54 AM #25 Last Edit: November 27, 2010, 12:18:28 PM by chadon
I tried this mod on SMF: 2.0 RC3 but the text tags below are not showing on the registration page. Does anyone have any idea what I can replace them with? My forum is in French.

      <strong>', $txt['dob'], '</strong><br />
      <span class="smalltext">', $txt['dob_year'], ' - ', $txt['dob_month'], ' - ', $txt['dob_day'], '</span>


Update:

I checked the tags in the Profile.french.php file and they are the same as the ones on the mod so I don't understand what could be wrong. ???

$txt['dob'] = 'Date de naissance';

$txt['dob_month'] = 'Mois (MM)';

$txt['dob_day'] = 'Jour (JJ)';

$txt['dob_year'] = 'Année (AAAA)';


Update 2:

I don't know if I did the right thing but I added the text strings above in Modifications.french.php and it fixed my problem. I didn't notice any bug with either the registration page or the profile page with those strings in 2 language files but if someone has a better solution, let me know.  :)

SC RaceFan

March 14, 2011, 05:53:46 PM #26 Last Edit: March 14, 2011, 06:01:14 PM by SC RaceFan
I don't see how to make it a drop down. Oh, 2.0 RC5.  I went to your site and registered Afro and didn't see either field day or month.  I just went to the profile on here and it has Birthday.....some one needs to share LOL
If I knew what I was doing, I would not be here asking question!  If I were a programmer, I would not need you!

sliverz

Ok, This works on the member registration, but not on administrator's new member registration.

As an administrator I already have a list of members I need to add and assign group member, their birthday, and maybe their avatars image.

So I need to do it from the admin page -> Members -> Register New Member.

Otherwise I have to update their profile after I add them. Which will be a lot of work. I'm looking for the fastest way to do this.

I noticed the fields smf use are : bday3 for year, bday1 for month, and bday2 for date. I tried to add these fields on the form and post it, but it doesn't work.

Any idea?

Joker™

Quote from: SC RaceFan on March 14, 2011, 05:53:46 PM
I don't see how to make it a drop down. Oh, 2.0 RC5.  I went to your site and registered Afro and didn't see either field day or month.  I just went to the profile on here and it has Birthday.....some one needs to share LOL


Go to
Administration Center » Core Features >> Advanced Profile Fields (enable it)



Then go to
Administration Center » Features and Options » Profile Fields >> Add new field there and adjust options as per your liking.



Quote from: sliverz on April 08, 2011, 12:13:52 PM
Ok, This works on the member registration, but not on administrator's new member registration.

As an administrator I already have a list of members I need to add and assign group member, their birthday, and maybe their avatars image.

So I need to do it from the admin page -> Members -> Register New Member.

Otherwise I have to update their profile after I add them. Which will be a lot of work. I'm looking for the fastest way to do this.

I noticed the fields smf use are : bday3 for year, bday1 for month, and bday2 for date. I tried to add these fields on the form and post it, but it doesn't work.

Any idea?
That will require some coding, open a new thread someone might help you there, as this thread is already marked as solved.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

drroot

Yes. same question here. Any more details?

How to use bday3-bday1-bday2 in good formated "Profile fields"?

Thanks.

Illori

please open a separate thread for your issue, this thread belongs to someone else and is marked solved. also please dont bump old threads.

dooie

Thank you for your information, I forgot to add the <dl></dl> open and close tags, now everything lines up.

Cheers.

Advertisement: