[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 !

[Add-on] Gender Required Field v0.9.1

Postby kooky on Mon 29. Sep, 2003 17:25

MOD Title: Gender Required Add-on
MOD Author: Niels <ncr@db9.dk> (Niels Chr. Rød) http://mods.db9.dk
Kooky <n/a> (n/a) http://perso.edeign.com/kooky/
MOD Description: This Mod will force your users to enter their gender on registration and profile edition.
You can able/disable this option via the Admin CP
MOD Version: 0.9.1
MOD Demo: there (try to register)

MOD Require:Gender Mod v1.2.5
Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk

Installation Level: Easy
Installation Time: 10 Minutes
Files To Edit: 6
Included Files: n/a
MOD Download: Gender Required Field Add-on
or see below

Code: Select all
## easymod compliant
##############################################################
## MOD Title:      Gender Required Add-on
## MOD Author:      Niels <ncr@db9.dk> (Niels Chr. Rød) http://mods.db9.dk
##         Kooky <n/a> (n/a) http://perso.edeign.com/kooky/
## MOD Description:   This Mod will force your users to enter their gender
##         on registration and profile edition.
##         You can able/disable this option via the Admin CP
## MOD Version:      0.9.1
## Compatibility:   2.0.3 - 2.0.10
##
## MOD Require:      Gender Mod v1.2.6
##         Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
##
## Installation Level:   Easy
## Installation Time:   10 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit:   6
##         admin/admin_board.php
##         includes/usercp_register.php
##         language/lang_english/lang_admin.php
##         language/lang_english/lang_main.php
##         templates/subSilver/profile_add_body.tpl
##         templates/subSilver/admin/board_config_body.tpl
## Included Files:   n/a
##
##############################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## For Security Purposes, Please Check: http://mods.db9.dk for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, Open Tools.de will not offer support for MOD's not offered
## in our MOD-Database, located at: http://mods.db9.dk/viewforum.php?f=3
##############################################################
## Author Note:
## Make sure you have installed the Gender Mod v1.2.6 before to use this Add-on
## To install the SQL query, use your database manager (e.g.: phpMyAdmin).
##
##############################################################
## MOD History:
##
## 2004-08-21 - Version 0.9.1
##   - Fixed issue with XML/XHTML
##   - Added french translation
##
## 2003-09-29 - Version 0.9.0
##   - Initial release (firt release)
##   - Easy Mod compliant
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]-------------------------------------------------
#
# If you use a beta release of EasyMOD, this instructions will be executed!
# Please read author notes to update your database.
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gender_required', '0');

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
$lang['No_gender_specify'] = 'None Specified';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Gender_require'] = 'Your Gender is required on this site.';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Start add - Gender Mod
$lang['Gender_required'] = 'Force users to submit their gender';
// End add - Gender Mod
#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------------
#
      $avatar_sql = user_avatar_gallery($mode, $error, $error_msg, $user_avatar_local);
   }
#
#-----[ AFTER, ADD ]------------------------------------------
#
   // Start add - Gender Mod
   if ( $board_config['gender_required'] )
   {
      if (!$gender)
      {
         $error = TRUE;
         $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Gender_require'];
      }
   }
   // End add - Gender Mod
#
#-----[ FIND ]------------------------------------------------
#
      'GENDER' => $gender,

#
#-----[ AFTER, ADD ]------------------------------------------
#
      'GENDER_REQUIRED' => ( $board_config['gender_required'] ) ? ' *' : '',
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]------------------------------------------------
#
$smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Gender Mod
$gender_required_yes = ( $new['gender_required'] ) ? ' checked="checked"' : '';
$gender_required_no = ( !$new['gender_required'] ) ? ' checked="checked"' : '';
// End add - Gender Mod
#
#-----[ FIND ]------------------------------------------------
#
   "L_RESET" => $lang['Reset'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
   // Start add - Gender Mod
   "L_GENDER_REQUIRED" => $lang['Gender_required'],
   "GENDER_REQUIRED_YES" => $gender_required_yes,
   "GENDER_REQUIRED_NO" => $gender_required_no,
   // End add - Gender Mod
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
   <tr>
      <td class="row1"><span class="gen">{L_GENDER}:</span></td>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{L_GENDER}:
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
{GENDER_REQUIRED}
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
   <tr>
      <td class="row1">{L_BOARD_EMAIL_FORM}<br /><span class="gensmall">{L_BOARD_EMAIL_FORM_EXPLAIN}</span></td>
      <td class="row2"><input type="radio" name="board_email_form" value="1" {BOARD_EMAIL_FORM_ENABLE} /> {L_ENABLED}&nbsp;&nbsp;<input type="radio" name="board_email_form" value="0" {BOARD_EMAIL_FORM_DISABLE} /> {L_DISABLED}</td>
   </tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
   <tr>
      <td class="row1">{L_GENDER_REQUIRED}</td>
      <td class="row2">
         <input type="radio" name="gender_required" value="1"{GENDER_REQUIRED_YES} />
         <span class="genmed">{L_YES}</span>&nbsp;&nbsp;
         <input type="radio" name="gender_required" value="0"{GENDER_REQUIRED_NO} />
         <span class="genmed">{L_NO}</span>
      </td>
   </tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


Note: support for this Add-on only on this topic.
Report any bugs or error... ^_^
Last edited by kooky on Thu 18. Nov, 2004 18:09, edited 5 times in total.
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby carloclaessen on Tue 04. Nov, 2003 01:28

Just to let you know, it works great!!!

Thx
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Postby Colleen on Wed 04. Feb, 2004 20:53

(It's ok now, got it working)

Hello,

I manually applied this mod and entered the SQL query and did everything else and nothing is happening.

It isn't make it a required field and I don't see it in my admin panel. I must have done something incorrect. Anyone have any ideas? Thank you.

Colleen
Colleen
Poster
Poster
 
Posts: 1
Joined: Wed 04. Feb, 2004 09:55

Postby carloclaessen on Wed 21. Apr, 2004 15:25

is there a way to stop changing after registration

never mind found it out

Code: Select all
<!-- BEGIN switch_confirm -->
<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_confirm -->
<!-- BEGIN switch_edit_profile -->
<tr>
<td><span class="explaintitle">{L_GENDER}:{GENDER_REQUIRED}</span></td>
<td>
<input type="hidden" {LOCK_GENDER} name="gender" value="0" {GENDER_NO_SPECIFY_CHECKED}/>
<span class="gen">{L_GENDER_NOT_CHANGE}</span>&nbsp;&nbsp;
<input type="hidden" name="gender" value="1" {GENDER_MALE_CHECKED}/>
<span class="gen"></span>&nbsp;&nbsp;
<input type="hidden" name="gender" value="2" {GENDER_FEMALE_CHECKED}/>
<span class="gen"></span></td>
</tr>
<!-- END switch_edit_profile -->
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Postby carloclaessen on Wed 21. Apr, 2004 21:50

sorry i come back on the code above, its not working correct, when i use it i edit my profile it switch from male to female, how rare???
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Postby carloclaessen on Fri 23. Apr, 2004 13:15

bump, i need this, somebody there who knows
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Postby kooky on Fri 23. Apr, 2004 16:08

very easy :D
in your profile_add_body.tpl
replace gender code with this one:
Code: Select all
<!-- Start add - Gender MOD -->
<tr>
      <td class="row1"><span class="gen">{L_GENDER}:{GENDER_REQUIRED}</span></td>
      <td class="row2">
      <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" {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 -->


i just add this variable: {LOCK_GENDER} :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 09:56

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
carloclaessen
Poster
Poster
 
Posts: 97
Joined: Mon 16. Dec, 2002 01:38

Next

Return to Gender [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron