[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 draky on Thu 20. May, 2004 16:22

and wath is the exact thing to do ?

with all the codes i'm lost :P

Maybe an addon can be posted in kooky's 1st post ;)

thanks a lot :)
draky
Poster
Poster
 
Posts: 7
Joined: Sat 19. Apr, 2003 12:00
Location: France

Postby splitfire on Fri 21. May, 2004 03:01

splitfire
Poster
Poster
 
Posts: 2
Joined: Thu 20. May, 2004 07:58

Postby TheRealKoston on Sat 24. Jul, 2004 12:29

Code: Select all
##############################################################
## MOD Title:   Gender Required Field Mod (Add-on)
## MOD Version:   0.9.0
## Translation:   Deutsch (German)
## Rev date:   24/07/2004
##
## Translator:   TheRealKoston < therealkoston@yahoo.de > (n/a)
##
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_german/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
$lang['No_gender_specify'] = "keine Angabe";
#
#-----[ AFTER, ADD ]------------------------------------------
#

$lang['Gender_require'] = 'Die Eingabe des Geschlechts ist erforderlich';

#
#-----[ OPEN FILE ]------------------------------------------
#
language/lang_german/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#

// Start add - Gender Mod
$lang['Gender_required'] = 'Die Eingabe des Geschlechts erforderlich machen';
// End add - Gender Mod

#
#-----[ SAVE & CLOSE ]------------------------------------------
#
# EoM

German Translation :roll:
TheRealKoston
Poster
Poster
 
Posts: 3
Joined: Sat 10. Jan, 2004 13:57

Postby cbl2 on Fri 20. Aug, 2004 01:03

Does anyone have a db_update.php for this mod, as I cannot use myphpadmin. Thanks.
cbl2
Poster
Poster
 
Posts: 5
Joined: Sat 14. Aug, 2004 16:25

Postby kooky on Fri 20. Aug, 2004 01:08

cbl2 wrote:Does anyone have a db_update.php for this mod, as I cannot use myphpadmin. Thanks.
create a file with .php extension and add this code:
Code: Select all
<?php

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
define('SITE_HISTORY_TABLE', $table_prefix.'site_history');


$sql=array(
'INSERT INTO ' . CONFIG_TABLE . ' (config_name, config_value) VALUES ("gender_required", "0")'
);

$mods = array (
'Gender Mod'
);


//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

if ($userdata['user_level']!=ADMIN)
      message_die(GENERAL_ERROR, "You are not Authorised to do this");
$n=0;
$message="<b>This list is a result of the SQL queries needed for the additional mods in the pre-moded pack</b><br/><br/>";
while($sql[$n])
{
   $message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : '';
   if(!$result = $db->sql_query($sql[$n]))
   $message .= '<b><font color=#FF0000>[Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
   else $message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
   $n++;
}
message_die(GENERAL_MESSAGE, $message);
?>


Upload this new file and run it :wink:
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby kooky on Sat 21. Aug, 2004 14:37

New version is 0.9.1

Changelog:
- Fixed issue with XML/XHTML
- Added french translation

How to update:
Code: Select all
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]------------------------------------------------
#
// Start add - Gender Mod
$gender_required_yes = ( $new['gender_required'] ) ? "checked=\"checked\"" : "";
$gender_required_no = ( !$new['gender_required'] ) ? "checked=\"checked\"" : "";
// End add - Gender Mod
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Start add - Gender Mod
$gender_required_yes = ( $new['gender_required'] ) ? ' checked="checked"' : '';
$gender_required_no = ( !$new['gender_required'] ) ? ' checked="checked"' : '';
// End add - Gender Mod
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
   <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>
#
#-----[ REPLACE WITH ]------------------------------------------
#
   <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>
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

Postby mguffey5 on Wed 06. Oct, 2004 03:08

Is there anyway to make this a mandatory on the registration page.
mguffey5
Poster
Poster
 
Posts: 4
Joined: Thu 23. Sep, 2004 01:31

Postby kooky on Wed 06. Oct, 2004 20:25

mguffey5 wrote:Is there anyway to make this a mandatory on the registration page.
set it in your AdminCP :wink:
kooky
brilliant supporter
 
Posts: 1329
Joined: Tue 31. Dec, 2002 17:52
Location: Au pays des rêves

PreviousNext

Return to Gender [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron