Male / Female Only

Mod that adds a extra field to the users profile, the gender is displayed beside the posts

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Male / Female Only

Postby Ed Guy on Thu 10. Nov, 2005 13:02

HI,

How could I restrict the 'Unknown' field from users? I want to force users to choose Male or Female option.

Regards,

Ed :?:
Ed Guy
Poster
Poster
 
Posts: 3
Joined: Wed 03. Mar, 2004 14:05
Location: Brazil

Postby Beeveer on Thu 10. Nov, 2005 22:48

If they have choosed they can't go back to the unknown field.
Nee, ik geef geen antwoorden in het Nederlands, die horen thuis op www.phpbb.nl ;)
User avatar
Beeveer
brilliant supporter
 
Posts: 264
Joined: Tue 30. Nov, 2004 19:13
Location: Boskoop, South-Holland, the Netherlands

Postby Ed Guy on Fri 11. Nov, 2005 00:38

Hi,

Beeveer wrote:If they have choosed they can't go back to the unknown field.


Sorry, I did not understand. Does it mean the user only can choose the gender option once when subscribing? The user can't change the gender option later?

I would like to remove the 'none' (or unknown) option from the gender form (keeping only male and female), so I've changed my phpbb subscribe page code and removed the 'none' option from the form. Unfortunately it did not work. Now many users are experiencing problems...

Thanks for your attention,
(nice picture!)

Ed
Ed Guy
Poster
Poster
 
Posts: 3
Joined: Wed 03. Mar, 2004 14:05
Location: Brazil

Postby [cz]aldaris on Fri 11. Nov, 2005 03:45

Ed Guy wrote:Sorry, I did not understand. Does it mean the user only can choose the gender option once when subscribing? The user can't change the gender option later?

Nope.. Beeveer meant, that when user once selects Male or Female, he can't go back to Unspecified option anymore. But he still can make a change form Man to Woman and vice versa. If someone undergoes some plastic surgery or what :mrgreen:

EDIT: I was thinking about it and this should be it. Backup all files before editing!!!
This modification will NOT remove the Non specified option, but user will be forced to choose the gender. Gender field is now marked with *, so he must specify his gender. Once he specify it, he will not be able to move back to Not specified, because this field is disabled from the first time.
Code: Select all
#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------------
#
      if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
   
#
#-----[ REPLACE WITH ]----------------------------------------
#
      if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) || ($gender == 0) )

#
#-----[ FIND ]------------------------------------------------
#
      'LOCK_GENDER' =>($mode!='register') ? 'DISABLED':'',

#
#-----[ REPLACE WITH ]----------------------------------------
#
      'LOCK_GENDER' => 'DISABLED',

#
#-----[ OPEN ]------------------------------------------------
#
templates/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<!-- Start add - Gender MOD -->
<tr>
      <td class="row1"><span class="gen">{L_GENDER}:</span></td>

#
#-----[ REPLACE WITH ]----------------------------------------
#
<!-- Start add - Gender MOD -->
<tr>
      <td class="row1"><span class="gen">{L_GENDER}: *</span></td>

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
User avatar
[cz]aldaris
Poster
Poster
 
Posts: 2
Joined: Thu 03. Nov, 2005 01:28

Postby Beeveer on Fri 11. Nov, 2005 09:45

Kooky already did the work for you: http://mods.db9.dk/viewtopic.php?t=3042 ;)
Nee, ik geef geen antwoorden in het Nederlands, die horen thuis op www.phpbb.nl ;)
User avatar
Beeveer
brilliant supporter
 
Posts: 264
Joined: Tue 30. Nov, 2004 19:13
Location: Boskoop, South-Holland, the Netherlands


Return to Gender [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 0 guests

cron