09 Gender Mod

Started by Mindless, February 05, 2013, 09:07:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

denede


Mindless

Gender mod.

SQL:

Code (sql) Select
ALTER TABLE users ADD gender ENUM('Male','Female','NA') NOT NULL default 'NA';

My.php find:

Code (html) Select
<input type='radio' name='acceptpms'" .  ($CURUSER["acceptpms"] == "no" ? " checked='checked'" : "") . " value='no' />{$lang['my_only_staff']}"
    ,1);


under add:

Code (php) Select
$HTMLOUT.= tr($lang['my_gender'], "<input type='radio' name='gender'" . ($CURUSER["gender"] == "Male" ? " checked='checked'" : "") . " value='Male' />{$lang['my_male']}
    <input type='radio' name='gender'" . ($CURUSER["gender"] == "Female" ? " checked='checked'" : "") . " value='Female' />{$lang['my_female']}
    <input type='radio' name='gender'" . ($CURUSER["gender"] == "NA" ? " checked='checked'" : "") . " value='NA' />{$lang['my_na']}", 1);


takeprofedit.php find:

Code (php) Select
$acceptpms = $_POST["acceptpms"];

under add:

Code (php) Select
$gender = htmlspecialchars($_POST["gender"]);

find:

Code (php) Select
$updateset[] = "acceptpms = " . sqlesc($acceptpms);

under add:

Code (php) Select
$updateset[] = "gender = " . sqlesc($gender);

userdetails.php find:

Code (php) Select
$HTMLOUT .= "<tr><td class='rowhead'>{$lang['userdetails_avatar']}</td><td align='left'><img src='" . htmlspecialchars($user["avatar"]) . "' width='{$user['av_w']}' height='{$user['av_h']}' alt='' /></td></tr>\n";

under add:

Code (php) Select
$HTMLOUT.= "<tr><td class='rowhead'>{$lang['userdetails_gender']}</td><td align='left'><img src='{$TBDEV['pic_base_url']}" . htmlspecialchars($user["gender"]) . ".gif' border='0' alt='" . htmlspecialchars($user["gender"]) . "' title='" . htmlspecialchars($user["gender"]) . "' /></td></tr>\n";

lang_my.php add:

Code (html) Select
'my_gender' => 'Gender',
'my_male' => 'Male',
'my_female' => 'Female',
'my_na' => 'Female',


lang_userdetails.php add:

Code (html) Select
'userdetails_gender' => 'Gender',

signup.php add :

Code (php) Select
$gender = '';
$gender.= "<select name=\"gender\">
    <option value=\"Male\">{$lang['signup_male']}</option>
    <option value=\"Female\">{$lang['signup_female']}</option>
    <option value=\"NA\">{$lang['signup_na']}</option>
    </select>";


Add under username and password boxes or where ever you want it:

Code (html) Select
<tr><td align='right' class='heading'>{$lang['signup_gender']}</td><td align='left'>$gender</td></tr>

takesignup.php add :

Code (php) Select
$gender = isset($_POST['gender']) && isset($_POST['gender']) ? htmlspecialchars($_POST['gender']) : 'NA';

Then add to the insert into users query within the sqlesc array.

Code (sql) Select
, gender

Code (sql) Select
, $gender

lang_signup.php add:

Code (html) Select
'signup_male' => 'Male',
    'signup_female' => 'Female',
    'signup_na' => 'N/A',
    'signup_gender' => 'Gender',


https://github.com/Bigjoos/U-232-V3/blob/master/pic/Female.gif
https://github.com/Bigjoos/U-232-V3/blob/master/pic/Male.gif
https://github.com/Bigjoos/U-232-V3/blob/master/pic/NA.gif