[Add-on] Gender Required Field v0.9.1

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 !

Postby kooky on Sat 24. Apr, 2004 20:12

carloclaessen wrote:i did try that

it doesnt work, it keeps on telling gender is required

also when i use it that way people arent able to set gender on registration

hoping for a solutions

grtz Carlo

Tested and worked (for me) :wink:
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby carloclaessen on Sat 24. Apr, 2004 20:51

errrrhm

can you exactly say what needs to be changed, so new members can register and choose and when registered they cant change

my code part now

edited removed to avoid confusion
like you see only other way i did it i set the positions different
Last edited by carloclaessen on Sun 25. Apr, 2004 01:02, edited 1 time in total.
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Postby carloclaessen on Sun 25. Apr, 2004 01:00

i found it out

(sorry mosymuis did, but with the switches i was pretty good on the way)

For users who want it also

open profile_add_body.tpl

find the gender part

Code: Select all
<tr>
<td><span class="explaintitle">{L_GENDER}:{GENDER_REQUIRED}</span></td>
<td>
<input type="radio" {LOCK_GENDER} name="gender" value="0" {GENDER_NO_SPECIFY_CHECKED}/>
<span class="gen">{L_GENDER_NOT_SPECIFY}</span>&nbsp;&nbsp;
<input type="radio" name="gender" value="1" {GENDER_MALE_CHECKED}/>
<span class="gen">{L_GENDER_MALE}</span>&nbsp;&nbsp;
<input type="radio" name="gender" value="2" {GENDER_FEMALE_CHECKED}/>
<span class="gen">{L_GENDER_FEMALE}</span></td>
</tr>


replace with

Code: Select all
<!-- BEGIN switch_user_logged_out -->
<tr>
<td><span class="explaintitle">{L_GENDER}:{GENDER_REQUIRED}</span></td>
<td>
<input type="radio" {LOCK_GENDER} name="gender" value="0" {GENDER_NO_SPECIFY_CHECKED}/>
<span class="gen">{L_GENDER_NOT_SPECIFY}</span>&nbsp;&nbsp;
<input type="radio" name="gender" value="1" {GENDER_MALE_CHECKED}/>
<span class="gen">{L_GENDER_MALE}</span>&nbsp;&nbsp;
<input type="radio" name="gender" value="2" {GENDER_FEMALE_CHECKED}/>
<span class="gen">{L_GENDER_FEMALE}</span></td>
</tr>
<!-- END switch_user_logged_out -->
<!-- BEGIN switch_user_logged_in -->
<tr>
<td><span class="explaintitle">{L_GENDER}:{GENDER_REQUIRED}</span></td>
<td>
<input type="hidden" name="gender" value="{GENDER}" />
<span class="gen">{L_GENDER_NOT_CHANGE}</span>
</td>
</tr>
<!-- END switch_user_logged_in -->


like you notced i have added an extra line into it

open usercp_register.php

find

Code: Select all
      'L_GENDER_NOT_SPECIFY' =>$lang['No_gender_specify'],


after add

Code: Select all
      'L_GENDER_NOT_CHANGE' =>$lang['No_gender_change'],


at last

open lang_main.php

find

Code: Select all
$lang['Gender_require'] = 'Your Gender is required on this site.';


after add

Code: Select all
$lang['No_gender_change'] = 'Changing Your Gender isnt Allowed';


in my opnion i think i helped a lot off people with this!
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Postby kooky on Sun 25. Apr, 2004 02:52

this is one of the best solution :roll:
{LOCK_GENDER} isn't made to lock all values :?
i have the same issue with a similar "lock_field" in Moderator CP MOD when we try to edit a profile
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby carloclaessen on Sun 25. Apr, 2004 03:23

the solution i typed above is now tested and running on 6 sites, its running ok and all gender field required messages are gone like snow for sun, still thx for the time, this part was easy compared to the next target, making it so the birthday isnt editable anymore
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Postby carloclaessen on Wed 28. Apr, 2004 23:22

kooky or -==et==- you may convert it to EM compatble, i dont support EM just mention my name
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Postby kooky on Fri 30. Apr, 2004 02:50

carloclaessen wrote:kooky or -==et==- you may convert it to EM compatble, i dont support EM just mention my name

EM (non-)compliant
tested on phpBB 2.0.8 + Gender Mod
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby splitfire on Thu 20. May, 2004 11:23

Simpler yet, adding kooky's not-all-the-way-thought-through idea to carlos' working solution :) :

Code: Select all
<!-- BEGIN switch_user_logged_out -->
<!-- Start add - Gender MOD -->
<tr>
      <td class="row1"><span class="gen">{L_GENDER}:{GENDER_REQUIRED}</span></td>
      <td class="row2">
      <input type="radio" name="gender" value="1" {GENDER_MALE_CHECKED}/>
      <span class="gen">{L_GENDER_MALE}</span>&nbsp;&nbsp;
      <input type="radio" name="gender" value="2" {GENDER_FEMALE_CHECKED}/>
      <span class="gen">{L_GENDER_FEMALE}</span></td>
</tr>
<!-- End add - Gender MOD -->
<!-- END switch_user_logged_out -->

<!-- BEGIN switch_user_logged_in -->
<!-- Start add - Gender MOD -->
<tr>
      <td class="row1"><span class="gen">{L_GENDER}:{GENDER_REQUIRED}</span></td>
      <td class="row2">
      <input type="hidden" name="gender" value="{GENDER}">
      <input type="radio" {LOCK_GENDER} name="gender" value="1" {GENDER_MALE_CHECKED}/>
      <span class="gen">{L_GENDER_MALE}</span>&nbsp;&nbsp;
      <input type="radio" {LOCK_GENDER} name="gender" value="2" {GENDER_FEMALE_CHECKED}/>
      <span class="gen">{L_GENDER_FEMALE}</span></td>
</tr>
<!-- End add - Gender MOD -->
<!-- END switch_user_logged_in -->



Instead of "Changing your gender isn't allowed", it displays the radio buttons locked on the user's gender.

Note: I removed the "unspecified" portion since there's no need for it once you've made gender required.
splitfire
Poster
Poster
 
Posts: 2
Joined: Thu 20. May, 2004 07:58

PreviousNext

Return to Gender [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron