Notice:
This tip has been in some way ported over to be a modification package located on the SMF modsite (http://mods.simplemachines.org/index.php?mod=407). Please note, the mod package may not do the exact same function and may not even use any of the code originally written for the tip, but should still hold the same basic functionality of the tip posted here. With the mod package for this tip, you can now let the SMF package manager make the code changes for you without you having to look at the code and edit it manually.
For documentation on using the SMF package manager, view this document (http://docs.simplemachines.org/index.php?board=49.0).
To download the modification package, [please click here (http://mods.simplemachines.org/index.php?mod=407)].
Is there a mod that makes people choose gender at registration? I have a couple of forums which one is for men and one for women.
You can do this the same way you do custom profile fields, using something like:
<input type="radio" name="gender" value="0" checked="checked" /> Leave it to the imagination<br />
<input type="radio" name="gender" value="1" /> Male<br />
<input type="radio" name="gender" value="2" /> Female<br />
In the Register template.
-[Unknown]
Where in there do I put this?
Where ever you want the option to appear :P.
For example, if you wanted it after the password, you'd find:
</tr><tr>
<td width="40%">
<b>', $txt[82], ':</b>
</td>
<td>
<input type="password" name="passwrd2" size="30" />
</td>
</tr>
Add after that:
</tr><tr>
<td width="40%">
<b>Gender:</b>
</td>
<td>
<input type="radio" name="gender" value="0" checked="checked" /> Leave it to the imagination<br />
<input type="radio" name="gender" value="1" /> Male<br />
<input type="radio" name="gender" value="2" /> Female<br />
</td>
</tr>
If you're not comfortable with HTML, I suggest you look at the tutorials on www.w3schools.com ;).
-[Unknown]
Alright, I have tried adding this several times and every time I save, it never takes.
Aha, I figured it out!! yeah :)
Can i add new questions/>?
Quote from: kadhumia_flo on August 26, 2005, 05:22:19 PM
Can i add new questions/>?
Of course you can ask questions in these topics (like you just did) just don't post new topics in this board that are questions.
-[Unknown]
thanks for this post! i find this very useful. it's also a good way for me to learn the PHP language, looking at how they modify things in the board, slowly and piece by piece.
Quote from: [Unknown] on February 14, 2005, 07:02:58 PM
Where ever you want the option to appear :P.
For example, if you wanted it after the password, you'd find:
</tr><tr>
<td width="40%">
<b>', $txt[82], ':</b>
</td>
<td>
<input type="password" name="passwrd2" size="30" />
</td>
</tr>
Add after that:
</tr><tr>
<td width="40%">
<b>Gender:</b>
</td>
<td>
<input type="radio" name="gender" value="0" checked="checked" /> Leave it to the imagination<br />
<input type="radio" name="gender" value="1" /> Male<br />
<input type="radio" name="gender" value="2" /> Female<br />
</td>
</tr>
If you're not comfortable with HTML, I suggest you look at the tutorials on www.w3schools.com ;).
-[Unknown]
Sir can tell me what file should i edit ? and where @ plz
Register.template.php located in /Themes/default folder.
Quote from: JayBachatero on November 21, 2005, 06:42:01 PM
Register.template.php located in /Themes/default folder.
Can i use this with 7dana theme too ?
Well check in the themes folder and check if it inclused a file called Register.template.php if not just editing the one in the default theme will carry on for all other templated that do not include a custom template.
Quote from: JayBachatero on November 21, 2005, 07:37:28 PM
Well check in the themes folder and check if it inclused a file called Register.template.php if not just editing the one in the default theme will carry on for all other templated that do not include a custom template.
Thanks a lot for ur help smf rocks
You're welcome.
Quote from: JayBachatero on November 21, 2005, 07:45:51 PM
You're welcome.
Sir sorry to bug u again and again i dont know if it works coz when i try to register a new account it says
An Error Has Occurred!
You are not allowed to access this section
Because you can only register once every 30 minutes. What you can do is use different browsers to test it out.
Quote from: JayBachatero on November 21, 2005, 08:21:36 PM
Because you can only register once every 30 minutes. What you can do is use different browsers to test it out.
Oh ok thanks a lot :X >:D< you are da best >:D<
You're welcome.
Is there a way to automatically redirect to the profile page after registering?
If I have "registration activation" enabled, could I also link the activation to the profile page?
I did this hack ... yes it put the fields in the registration form to choose .. but that about it .. even you you choose its still blank one the person sign up ??? any ideas ???
Can you please explain the problem you are having? I don't really undestand what you are trying to say.
Problem rectified ... thanks 8)
Little question about this lil add-on :
Can all this gender registration be saved on the database ? just to see a ratio of male vs female .
All that info is stored in the db.
Edit: Dont worry got it fixed, the code in my register file was just different to the one he explained.
Is there a way to REQUIRE the gender (and age) to be filled in upon Registration. I've added the code, but some members are still bypassing it.
they prolly pick the first one thats default which is "dont wanna tell" or some crap i edited the code and removed that, most of the members do it now. and you dont want to FORCE people to do anything thats the first line to screw up a website, i don't even make people require to check there emails on my site.
what this mod can do
It just makes it easier to tell who is male from female ... as they have to select it on sign up ..
See here on my site http://jagdyb.com/forum/index.php?action=register
how did you make that picture verification?
Quote from: rosoner on August 23, 2006, 06:40:26 AM
how did you make that picture verification?
http://www.simplemachines.org/community/index.php?topic=107234.0
thank you very much!
I just installed the mod and it is certainly progress that they see the gender question. Is there a way however that will force them to pick male or female and not have a 3rd option?
Does this mod support RC3 too?
Quote from: hawkman on August 29, 2006, 01:46:38 PM
I just installed the mod and it is certainly progress that they see the gender question. Is there a way however that will force them to pick male or female and not have a 3rd option?
Need help on this too... someone?
I would think if you removed this line that it would take the top option (N/A) out of the mix:
<input type="radio" name="gender" value="0" checked="checked" tabindex="', $context['tabindex']++, '" /> ', $txt[470], '<br />
I have just done this and if you remove that line it only leaves the male/female options.
can I use this mod for 1.1 latest smf?
I just tested it on 1.1.3, so I'd say that's a "yes"
On the package created from this, can I make a recommendation.
Replace "Gender" with the language string "', $txt[231], ':".
I just installed this mod and couldn't figure out why it wasn't working. When I went back and looked at it manually everything was fine as well. Then I realized that my SMF was using Modifications.english-utf8.php instead of Modifications.english.php D'OH!! I copied the regular one over to utf and it works... but why is it defaulting to the utf one where can i change that?
Thanx.
Jannah
All this mod does is change the register.template.php. Converting to utf is something you must do to your board.
To resolve this you need a backup of your database prior to converting to utf.
will someone update this mod.
No update needed the mod already supports current SMF versions.
Quote from: [Unknown] on February 14, 2005, 07:02:58 PM
Where ever you want the option to appear :P.
For example, if you wanted it after the password, you'd find:
</tr><tr>
<td width="40%">
<b>', $txt[82], ':</b>
</td>
<td>
<input type="password" name="passwrd2" size="30" />
</td>
</tr>
Add after that:
</tr><tr>
<td width="40%">
<b>Gender:</b>
</td>
<td>
<input type="radio" name="gender" value="0" checked="checked" /> Leave it to the imagination<br />
<input type="radio" name="gender" value="1" /> Male<br />
<input type="radio" name="gender" value="2" /> Female<br />
</td>
</tr>
If you're not comfortable with HTML, I suggest you look at the tutorials on www.w3schools.com ;).
-[Unknown]
Lets say i dont want a leave to imagination option, and i remove that line of code .. do i then have to change the value for male and female .. or they can remain on 1 & 2 ???
eg..
<input type="radio" name="gender" value="1" /> Male<br />
<input type="radio" name="gender" value="2" /> Female<br />
or
<input type="radio" name="gender" value="0" /> Male<br />
<input type="radio" name="gender" value="1" /> Female<br />
or
<input type="radio" name="gender" value="0" checked="checked" /> Male<br />
<input type="radio" name="gender" value="1" /> Female<br />
Which is the better code to use :-\
Any chance of a 2.0 RC3 port ?