4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: brandkanne on June 02, 2003, 02:12:19 PM

Title: [MOD] User GIS
Post by: brandkanne on June 02, 2003, 02:12:19 PM
be sure BACKUP your data first at all !!!!!!!
-------------------------------------------------

Mini MOD: User Gender Info Signs


Hi,

this is my first Mini MOD posting, so please don't hit me, if something wrong...

I add some user gender information like this:

Name1 (http://www.4homepages.de/forum/index.php?action=dlattach;topic=6000.0;id=24;image)
Name2 (http://www.4homepages.de/forum/index.php?action=dlattach;topic=6000.0;id=25;image)


Ok, here is the code:

Step 1
Code: [Select]
Add a new field "user_sex" in "4images_users" table
Step 1a!
At first setup, you must edit for each existing user the user_sex field by hand with m or w
i hope your database is not so huge :oops: (m=male, w=female)


Step 2
Open db_field_definitions.php

find
Code: [Select]
?>
add above
Code: [Select]
$additional_user_fields['user_sex'] = array($lang['user_sex'], "radio", 1);
Step 3
Open register_form.html

find
Code: [Select]
<form method="POST" action="{url_register}">
<table>

add after
Code: [Select]
         <tr>
            <td class="row1"><font size=-1> <b>Gender:</b></td>
            <td class="row1">
<font size=-1>
              <input type="radio" name="user_sex" value="m" checked />
              male&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_sex" value="w" />
              female</font>

</td>
          </tr>


Step 4
Save (http://www.4homepages.de/forum/index.php?action=dlattach;topic=6000.0;id=24;image) and  (http://www.4homepages.de/forum/index.php?action=dlattach;topic=6000.0;id=25;image) from here

Step 5
Upload these two images to your default template directory

Step 6
Open member_profile.html

find
Code: [Select]
{user_name}
add after
Code: [Select]
<img src="templates/default/images/{user_sex}.gif">

I thing you can repeat Step 6 on any template file...


I guess thats all!



But if you use MOD Memberlist, try this too:

Step 7
find
Code: [Select]
               case 'user_joindate':
                        $order_by = "user_joindate $sort_order";
                        break;

add above
Code: [Select]
               case 'user_sex':
                        $order_by = "user_sex $sort_order";
                        break;


Step 8
find
Code: [Select]
                       $order_by = "user_name $sort_order";

replace with
Code: [Select]
                       $order_by = "user_sex $sort_order";

Step 9
find
Code: [Select]
 while ($user_row = $site_db->fetch_array($result)){
  $user_id = "";

add after
Code: [Select]
                     $user_sex = "";
Step 10
find a few lines below
Code: [Select]
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;

add above
Code: [Select]
                    $user_sex = "<img src=\"templates/default/images/".htmlspecialchars($user_row['user_sex']).".gif\">".$var_name." ";



Step 11
find a few lines below
Code: [Select]
    $userlist .= "<td valign=\"top\" align=\"left\">".$session_ip." ".$user_name."</td>\n";

replace with
Code: [Select]
   $userlist .= "<td valign=\"top\" align=\"left\">".$session_ip." ".$user_name." ".$user_sex."</td>\n";


I guess i forgot nothing... i hope so
be sure BACKUP your data first at all !!!!!!!
Title: Mini MOD: User GIS
Post by: V@no on June 02, 2003, 10:04:44 PM
very nice! good job!

maybe good idea support this too: (http://www.4homepages.de/forum/index.php?action=dlattach;topic=6000.0;id=23;image)
;) u never know :D

P.S. moving this MOD into MODs forum ;)
Title: Mini MOD: User GIS
Post by: brandkanne on June 02, 2003, 10:29:57 PM
:oops: maybe, maybe... (http://www.4homepages.de/forum/index.php?action=dlattach;topic=6000.0;id=23;image)


New additional...

Step 3
Save this sign too ((http://www.4homepages.de/forum/index.php?action=dlattach;topic=6000.0;id=23;image))
Open register_form.html

find
Code: [Select]
<form method="POST" action="{url_register}">
<table>

add after
Code: [Select]
         <tr>
            <td class="row1"><font size=-1> <b>Gender:</b></td>
            <td class="row1">
              <input type="radio" name="user_sex" value="b" checked />
              not sure&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_sex" value="m" />
              male&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_sex" value="w" />
              female</font>
              </td>
          </tr>



but, in this case better is a new tag in member_editprofile.html
for opt. change gender later... or not?  :D
Title: installed -success ( ALMOST )
Post by: ib41 on June 03, 2003, 08:05:00 AM
Images not showing :(
I get the vicious RED X next to members  name in profile.

 :?:  :?:  :?:

the m.gif and w.gif ARE located in  templates/default/images
 folder

help please

Thanks inadvance
Title: Mini MOD: User GIS
Post by: drhtm on June 03, 2003, 09:09:43 AM
i'm sorry, but how do you add a new field to the database?
Title: Mini MOD: User GIS
Post by: brandkanne on June 03, 2003, 09:59:48 AM
Quote
i'm sorry, but how do you add a new field to the database?


i use phpMyAdmin... http://phpwizard.net/projects/phpMyAdmin/

browse to your database in 4images_users

click on:   Add new field: 1 At End of Table

choose varchar(1), set default to m

that's it.
Title: Re: installed -success ( ALMOST )
Post by: brandkanne on June 03, 2003, 10:09:37 AM
Quote from: ib41
Images not showing :(
I get the vicious RED X next to members  name in profile.

 :?:  :?:  :?:

the m.gif and w.gif ARE located in  templates/default/images
 folder


i guess, your probl. is the empty database field in user_sex for your existing users, right?

!
At first setup, you must edit each user_sex field by hand with m or w
i hope your database is not so huge :oops:
Title: Re: installed -success ( ALMOST )
Post by: V@no on June 03, 2003, 02:09:26 PM
Quote from: brandkanne
!
At first setup, you must edit each user_sex field by hand with m or w
i hope your database is not so huge :oops:

actualy when u are adding new field, just make default ('m')
if u already added that field, run this query to update all enteries:
Code: [Select]
UPDATE 4images_users SET user_sex = 'm'
Title: Mini MOD: User GIS
Post by: V@no on June 06, 2003, 05:01:55 AM
just notised, instead of
Quote
<img src="templates/default/images/{user_sex}.gif">
better use this:
Quote
<img src="{template_image_url}/{user_sex}.gif">
Title: Mini MOD: User GIS
Post by: spoiledRHOtten on June 17, 2003, 06:56:39 AM
Hi!

Okay...my question is this...if we set the user to default as "male" is there a way for them to change it?

I added the field that we added to the register_form.html form to the member_editprofile.html. BUT....it resets back to the male selection because it is set as marked. Is there a way to recall what the user marked so they dont have to keep changing it everytime they update their profile. I'm sure many people will forget to mark Female if they are female everytime the update their profile.

Please help!

Thank you!
Title: Mini MOD: User GIS
Post by: uksoreeyes on June 17, 2003, 09:18:52 AM
Post updated on: 19 June 2003, 03:21am
Quote from: spoiledRHOtten
Hi!

Okay...my question is this...if we set the user to default as "male" is there a way for them to change it?

There is but it's going to require a few changes to the original mod.

First open: includes/db_field_definitions.php

Find:
Code: [Select]
$additional_user_fields['user_sex'] = array($lang['user_sex'], "radio", 1);
Change to:
Code: [Select]
$additional_user_fields['user_sex'] = array($lang['user_sex'], "text", 0);

Open: member.php

Find:
Code: [Select]
   else {
      $user_icq_button = REPLACE_EMPTY;
    }

Below add:
Code: [Select]
// User Gender Switch
$gender_array = array("Male", "Female", "None Specified");
$user_gender = $gender_array[$user_row['user_sex']]." <img src=\"".TEMPLATE_PATH."/images/gender".$user_row['user_sex'].".gif\">";

Rename images to gender0.gif = male gender1.gif = female and gender3.gif = blank (nothing)

Find:
Code: [Select]
     "lang_email" => $lang['email'],
      "lang_homepage" => $lang['homepage'],
      "lang_icq" => $lang['icq']

Change to:
Code: [Select]
     "lang_email" => $lang['email'],
      "lang_homepage" => $lang['homepage'],
      "lang_icq" => $lang['icq'],
 "user_gender" => $user_gender,

Find:
Code: [Select]
   $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'

Change to:
Code: [Select]
   $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq', user_sex = '$user_gender'

Find:
Code: [Select]
 if ($config['account_activation'] == 2 && $user_info['user_level'] != ADMIN) {
    $edit_profile_msg .= $lang['edit_profile_email_msg_admin'];
  }

Below add:
Code: [Select]
// User Gender Switch
if($user_info['user_sex'] == 1){
$user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\" checked />
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\" />
              female</font>";
} else if($user_info['user_sex'] == 2){
$user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\"/>
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\" checked  />
              female</font>";
} else {
$user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\"/>
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\"/>
              female</font>";
}

Find:
Code: [Select]
   "lang_edit_profile_msg" => $edit_profile_msg,
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no']

Replace with:
Code: [Select]
   "lang_edit_profile_msg" => $edit_profile_msg,
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no'],
"user_gender" => $user_gender,

Open: templates/default/member_editprofile.html

Find:
Code: [Select]
         <tr>
            <td class="row1"><b>{lang_invisible}</b></td>
            <td class="row1"> <input type="radio" name="user_invisible" value="1"{user_invisible_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp; <input type="radio" name="user_invisible" value="0"{user_invisible_no} />
              {lang_no} </td>
          </tr>

Below add:
Code: [Select]
         <tr>
            <td class="row2"><b>Gender</b></td>
            <td class="row2">{user_gender}</td>
          </tr>

Open: templates/default/member_profile

Find:
Code: [Select]
<img src="templates/default/images/{user_sex}.gif">
Remove it.

Find:
Code: [Select]
       <tr>
          <td class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://wwp.icq.com/scripts/search.dll?to={user_icq}">{user_icq}</a>
            (<b>{user_icq_status}</b>){endif user_icq}</td>
        </tr>

Below add:
Code: [Select]
       <tr>
          <td class="row1"><b>Gender</b></td>
          <td class="row1">{user_gender}</td>
        </tr>


Thats about it I think, Save and close the files. I have tested on a fresh install of 4images and it works great.

Please inform me of any problems.

Carl
Title: Mini MOD: User GIS
Post by: V@no on June 17, 2003, 11:12:35 AM
@uksoreeyes:
first off, u shouldnt delete
Code: [Select]
$additional_user_fields['user_sex'] = array($lang['user_sex'], "radio", 1);simply change it to
Code: [Select]
$additional_user_fields['user_sex'] = array($lang['user_sex'], "text", 0);this way, u'll have an option in ACP when u edit or create new user.
also, if u use values as 1 = male, 2 = female and 3 = none then u'll save some headache and instead of:
Code: [Select]
// User Gender Switch
if($user_row['user_sex'] == 1){
   $user_gender = "Male <img src=\"templates/default/images/m.gif\">";
} else if($user_row['user_sex'] == 2){
   $user_gender = "Female <img src=\"templates/default/images/w.gif\">";
} else {
   $user_gender = "None Specified";
}
u could use:
Code: [Select]
// User Gender Switch
$gender_array = array("Male", "Female", "None Specified");
$user_gender = $gender_array[$user_row['user_sex']]." <img src=\"".TEMPLATE_PATH."/images/gender".$user_row['user_sex'].".gif\">";

for that u must rename images to gender0.gif = male gender1.gif = female and gender3.gif = blank (nothing)
Title: Mini MOD: User GIS
Post by: uksoreeyes on June 18, 2003, 11:08:20 AM
Quote from: V@no
Code: [Select]
// User Gender Switch
$gender_array = array("Male", "Female", "None Specified");
$user_gender = $gender_array[$user_row['user_sex']]." <img src=\"".TEMPLATE_PATH."/images/gender".$user_row['user_sex'].".gif\">";

I like how you done that V@no. could we do something like that with:

Code: [Select]
  // User Gender Switch
   if($user_info['user_sex'] == 1){
   $user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\" checked />
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\" />
              female</font>";
   } else if($user_info['user_sex'] == 2){
   $user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\"/>
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\" checked  />
              female</font>";
   } else {
   $user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\"/>
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\"/>
              female</font>";
   }

That seems like such a lot of code for such a simple task and would like it if it could be simplified like the code you done above.

Carl
Title: Mini MOD: User GIS
Post by: V@no on June 18, 2003, 12:48:35 PM
here is a code I use at my site:
Code: [Select]
$i = 0;
$gender = "";
$user_gender_select = array("none", "Male", "Female", "Both");
foreach ($user_gender_select as $key) {
$gender .= "<option value=\"".$i."\"".(($user_info['user_gender'] == $i) ? " selected" : "").">".$key."</option>\n";
$i++;
}

this will store dropdown options in $gender variable.
u may need change the array too.
Title: Mini MOD: User GIS
Post by: uksoreeyes on June 18, 2003, 01:59:33 PM
I got this error
Quote
Warning: Invalid argument supplied for foreach()
Title: Mini MOD: User GIS
Post by: V@no on June 18, 2003, 02:12:52 PM
are u sure? its working for me. just tryed on test file.
Title: Mini MOD: User GIS
Post by: uksoreeyes on June 18, 2003, 02:24:18 PM
It may have something to do with other code I'm using within my new profile.php file. The code could be conflicting with the user age display and the user zodiacs I have added. Just so you know, its the User Sexuality I'm working with (at the bottom)

Code: [Select]
if ($action == "editprofile") {

if ($user_info['user_level'] == GUEST) {
    show_error_page($lang['no_permission_updateprofile']);
    exit;
  }

// User Gender Switch
$gender_array = array("", "Male", "Female");
$user_gender = $gender_array[$user_info['user_gender']]."";

// User Age Display
$this_year=create_date('Y', time(), $board_config['board_timezone']);
$this_date = create_date('md', time(), $board_config['board_timezone']);

if ( $user_info['user_birthday'] != 999999 )
{
$poster_birthdate=realdate('md', $user_info['user_birthday']);
$n=0;
while ($n<26)
{
if ($poster_birthdate>=$zodiacdates[$n] & $poster_birthdate<=$zodiacdates[$n+1])
{
$zodiac = $lang[$zodiacs[($n/2)]];
$u_zodiac = $images[$zodiacs[($n/2)]];
$zodiac_img = '<img src="'.$u_zodiac.'" alt="'.$zodiac.'" title="'.$zodiac.'" border="0"/>';
$n=26;
} else
{
$n=$n+2;
}
}
$poster_age = $this_year - realdate ('Y',$user_info['user_birthday']);
   if ($this_date < $poster_birthdate) $poster_age--;
   $poster_age = '' . $poster_age .'';
} else
{
$poster_age = '';
}

// User Star Sign Display
if ($user_info['user_birthday']!=999999)
{
$poster_birthdate=realdate('md', $user_info['user_birthday']);
$i=0;
while ($i<26)
{
if ($poster_birthdate>=$zodiacdates[$n] & $poster_birthdate<=$zodiacdates[$i+1])
{
$zodiac = $lang[$zodiacs[($i/2)]];
$u_zodiac = $images[$zodiacs[($i/2)]];
$zodiac_img = $lang['Zodiac'].': <img src="'.$u_zodiac.'" alt="'.$zodiac.'" title="'.$zodiac.'" border="0"/>';
$i=26;
} else
{
$i=$i+2;
}
}
}

// User Sexuality Switch
$i = 0;
$sexuality = "";
$user_sexuality_select = array("", "Straight", "Bisexual", "Open Minded", "Gay / Lesbian");
foreach ($user_gender_select as $key) {
$sexuality .= "<option value=\"".$i."\"".(($user_info['user_sexuality'] == $i) ? " selected" : "").">".$key."</option>\n";
$i++;
}

Any ideas?
Title: Mini MOD: User GIS
Post by: V@no on June 18, 2003, 02:27:24 PM
u forgot change variable name in foreach():
Quote

$user_sexuality_select = array("", "Straight", "Bisexual", "Open Minded", "Gay / Lesbian");
foreach ($user_gender_select as $key) {
Title: Mini MOD: User GIS
Post by: uksoreeyes on June 18, 2003, 02:32:54 PM
haha I know, I just noticed and was about to delete the post, but it said 'you can't delete a post that has been replied to'

Thanks v@no
Title: Mini MOD: User GIS
Post by: V@no on June 18, 2003, 03:03:51 PM
that's right, because as I said it will make only options (<option>) and u need insert it in <select> form.
this is what I have:
Code: [Select]
             <select  name="user_gender" class="setperpageselect" />
                  {user_gender_options}
              </select>
Title: Mini MOD: User GIS
Post by: uksoreeyes on June 18, 2003, 03:06:26 PM
Yep got it now lol, I'm just not thinking straight today. Thats two simple mistakes I've made, maybe I should goto bed.  :lol:
Title: Mini MOD: User GIS
Post by: spoiledRHOtten on June 19, 2003, 03:20:34 AM
Quote from: uksoreeyes
Quote from: spoiledRHOtten
Hi!

Okay...my question is this...if we set the user to default as "male" is there a way for them to change it?

There is but it's going to require a few changes to the original mod.

First open: includes/db_field_definitions.php

Find:
Code: [Select]
$additional_user_fields['user_sex'] = array($lang['user_sex'], "radio", 1);
Remove it.

Open: member.php

Find:
Code: [Select]
   else {
      $user_icq_button = REPLACE_EMPTY;
    }

Below add:
Code: [Select]
// User Gender Switch
if($user_row['user_sex'] == 1){
$user_gender = "Male <img src=\"templates/default/images/m.gif\">";
} else if($user_row['user_sex'] == 2){
$user_gender = "Female <img src=\"templates/default/images/w.gif\">";
} else {
$user_gender = "None Specified";
}

Find:
Code: [Select]
     "lang_email" => $lang['email'],
      "lang_homepage" => $lang['homepage'],
      "lang_icq" => $lang['icq']

Change to:
Code: [Select]
     "lang_email" => $lang['email'],
      "lang_homepage" => $lang['homepage'],
      "lang_icq" => $lang['icq'],
 "user_gender" => $user_gender,

Find:
Code: [Select]
   $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'

Change to:
Code: [Select]
   $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq', user_sex = $user_gender

Find:
Code: [Select]
 if ($config['account_activation'] == 2 && $user_info['user_level'] != ADMIN) {
    $edit_profile_msg .= $lang['edit_profile_email_msg_admin'];
  }

Below add:
Code: [Select]
// User Gender Switch
if($user_info['user_sex'] == 1){
$user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\" checked />
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\" />
              female</font>";
} else if($user_info['user_sex'] == 2){
$user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\"/>
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\" checked  />
              female</font>";
} else {
$user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\"/>
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\"/>
              female</font>";
}

Find:
Code: [Select]
   "lang_edit_profile_msg" => $edit_profile_msg,
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no']

Replace with:
Code: [Select]
   "lang_edit_profile_msg" => $edit_profile_msg,
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no'],
"user_gender" => $user_gender,

Open: templates/default/member_editprofile.html

Find:
Code: [Select]
         <tr>
            <td class="row1"><b>{lang_invisible}</b></td>
            <td class="row1"> <input type="radio" name="user_invisible" value="1"{user_invisible_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp; <input type="radio" name="user_invisible" value="0"{user_invisible_no} />
              {lang_no} </td>
          </tr>

Below add:
Code: [Select]
         <tr>
            <td class="row2"><b>Gender</b></td>
            <td class="row2">{user_gender}</td>
          </tr>

Open: templates/default/member_profile

Find:
Code: [Select]
<img src="templates/default/images/{user_sex}.gif">
Remove it.

Find:
Code: [Select]
       <tr>
          <td class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://wwp.icq.com/scripts/search.dll?to={user_icq}">{user_icq}</a>
            (<b>{user_icq_status}</b>){endif user_icq}</td>
        </tr>

Below add:
Code: [Select]
       <tr>
          <td class="row1"><b>Gender</b></td>
          <td class="row1">{user_gender}</td>
        </tr>


Thats about it I think, Save and close the files. I have tested on a fresh install of 4images and it works great.

Please inform me of any problems.

Carl


okay...i did that...and now i get this:

Quote
DB Error: Bad SQL Query: UPDATE 4images_users SET user_email = 'spoiledRHOtten@hotmail.com', user_showemail = 1, user_allowemails = 1, user_invisible = 0, user_homepage = '', user_icq = '', user_sex = 2', user_cat_active = '1', user_pms_email = '1', user_pms_popup = '0', user_org = '', user_avatar = 'users/1.jpg', user_club = '', user_chapter = '' WHERE user_id = 1
You have an error in your SQL syntax near '', user_cat_active = '1', user_pms_email = '1', user_pms_popup = '0', user_org =' at line 2

please help!
Title: Mini MOD: User GIS
Post by: spoiledRHOtten on June 19, 2003, 03:27:27 AM
can i please send my member.php file to one of you? @V@no and uk?

help would be greatly appreciated.
Title: Mini MOD: User GIS
Post by: V@no on June 19, 2003, 03:47:39 AM
u missed one single quote:
Quote from: spoiledRHOtten
DB Error: Bad SQL Query: UPDATE 4images_users SET user_email = 'spoiledRHOtten@hotmail.com', user_showemail = 1, user_allowemails = 1, user_invisible = 0, user_homepage = '', user_icq = '', user_sex = '2', user_cat_active = '1', user_pms_email = '1', user_pms_popup = '0', user_org = '', user_avatar = 'users/1.jpg', user_club = '', user_chapter = '' WHERE user_id = 1
You have an error in your SQL syntax near '', user_cat_active = '1', user_pms_email = '1', user_pms_popup = '0', user_org =' at line 2
Title: Mini MOD: User GIS
Post by: spoiledRHOtten on June 19, 2003, 03:49:05 AM
okay...where should I add it?
Title: Mini MOD: User GIS
Post by: uksoreeyes on June 19, 2003, 03:59:10 AM
Quote from: spoiledRHOtten
okay...where should I add it?


user_sex = '$user_gender
Title: Mini MOD: User GIS
Post by: spoiledRHOtten on June 19, 2003, 04:01:27 AM
Quote from: uksoreeyes
Quote from: spoiledRHOtten
okay...where should I add it?


user_sex = '$user_gender

okay...now that i've done this...i think i'm back where i started with not being able to edit things in editprofile.html


because in editprofile.html...it allows for us to seeeee the sex...but not choose the sex now.
Title: Mini MOD: User GIS
Post by: uksoreeyes on June 19, 2003, 04:36:29 AM
I have updated my original post with the changes v@no suggested. I then done a fresh install of 4images, installed the original mod made by brandkanne. I then installed my mod, as it is now and everything seems to work fine. Check through your code and make sure everything matches my post.
Title: Re: Mini MOD: User GIS
Post by: b.o.fan on March 17, 2005, 11:10:42 PM
hat somebody gender-gif pics for me??

 :D :D
Title: Re: Mini MOD: User GIS
Post by: martrix on March 20, 2005, 07:22:45 PM
yes somebody "hat" ;)

(http://photo.overlord.cz/templates/default/images/m.gif)

(http://photo.overlord.cz/templates/default/images/w.gif)
and the most important:
(http://photo.overlord.cz/templates/default/images/b.gif)

(http://photo.overlord.cz/templates/blue_wonder/smiles/big_smile.gif)
Title: Re: Mini MOD: User GIS
Post by: b.o.fan on March 22, 2005, 07:50:23 PM
hmmmm... can somebody write a new MOD? this tread is very difficuld to understand. :-(

how is the name of the gender-gif´s???????


b.o.fan
Title: Re: Mini MOD: User GIS
Post by: martrix on March 22, 2005, 09:43:28 PM
come on! The mod is not so hard to implement!

the names of the gender gif are:

m.gif like man for the male sign

w.gif like woman for the female sign

and if you did use the third option then

b.gif like bisex for the hermafrodit sign ;)
Title: Re: Mini MOD: User GIS
Post by: ascanio on April 07, 2005, 06:32:23 AM
Quote
Step 1a!
At first setup, you must edit for each existing user the user_sex field by hand with m or w
i hope your database is not so huge Embarassed (m=male, w=female)

I have    1873 users and i don undestand what i have to do by hand :S is there anyother way?
Title: Re: Mini MOD: User GIS
Post by: V@no on April 07, 2005, 06:57:07 AM
I have    1873 users and i don undestand what i have to do by hand :S is there anyother way?
would be nice if u read replys atleast on the first page...
Title: Re: Mini MOD: User GIS
Post by: ascanio on April 07, 2005, 07:35:41 AM
I have read them all before post but i don understand this At first setup, you must edit for each existing user the user_sex field by hand with m or w
i hope your database is not so huge Embarassed (m=male, w=female)
Title: Re: Mini MOD: User GIS
Post by: V@no on April 07, 2005, 08:06:53 AM
there is a sollution on first page! I wouldnt say that if there wasnt any...
Title: Re: Mini MOD: User GIS
Post by: ascanio on April 07, 2005, 08:11:55 AM
Quote
actualy when u are adding new field, just make default ('m')
if u already added that field, run this query to update all enteries:
Code:
UPDATE 4images_users SET user_sex = 'm'

If this is the solution I don't understand this ... what I have to do please tell me. it working with the new user but not with de register before the instalation of the MOD I see a broken image
Title: Re: Mini MOD: User GIS
Post by: martrix on April 07, 2005, 10:26:19 AM
go to phpmyadmin, select the right db if you have more, open the query-window, paste UPDATE 4images_users SET user_sex = 'm' into the query field
and push "Submit query" that's all ;)
Title: Re: Mini MOD: User GIS
Post by: ascanio on April 07, 2005, 02:27:57 PM
Thank you so much! Matrix
Title: Re: Mini MOD: User GIS
Post by: ascanio on April 07, 2005, 03:06:15 PM
I don't find this on my memerlist.php
Code: [Select]
$userlist .= "<td valign=\"top\" align=\"left\">".$session_ip." ".$user_name."</td>\n";I put it in below this:
Code: [Select]
$userlist .= "<td valign=\"top\" align=\"center\">".$total_user_images_link."</td>";and when I go to see my member list I see a broken link image
Title: Re: Mini MOD: User GIS
Post by: V@no on April 07, 2005, 03:11:21 PM
what link image?
Title: Re: Mini MOD: User GIS
Post by: ascanio on April 07, 2005, 03:20:49 PM
did u went to my pege to see it ? I change it sorry I will put it again now
Title: Re: Mini MOD: User GIS
Post by: martrix on April 07, 2005, 04:22:16 PM
Thank you so much! Martrix

You're welcome

You don't have to add a new line, just add $user_sex right next to the name... or on any other place you wish - so you have to search for a line beginning
with $userlist containing the string $user_name. and replace that with $user_name." ".$user_sex. in the memberlist.php

when I go to see my member list I see a broken link image

and when you check the image-properties of that "broken image"?
What path is there? Did you save the m.gif w.gif (or also b.gif) @ the right place? (sorry, but you do not allow right-clicks, so I could not check it by myself...)
Title: Re: Mini MOD: User GIS
Post by: ascanio on April 07, 2005, 04:26:37 PM
the path is templates/default/images/m.gif but my template is call blue where can I change the path?
I put the Images there and it does work :)
I just dont get one thing . in the editmember_profile.htm the {user_gender} does not show up :( so the old user cannot change their gander
when I put a user as a female I also get a broken image and the path is this templates/blue/images/.gif :S
Title: Re: Mini MOD: User GIS
Post by: JensF on June 28, 2005, 01:15:06 AM
I have test this Mod but it doesn´t work.

It´s very difficuld to understand all the topics.

a new install where very good....

Title: Re: Mini MOD: User GIS
Post by: martrix on June 28, 2005, 01:30:34 AM
hm... if even such a dumb*** like me was able to follow the steps Jens, then you will be surely able to manage that too...
Just try to check if you did follow the steps as written - last time I was asked how help with this mod it came out, that one important step was missed...
Title: Re: Mini MOD: User GIS
Post by: Gulper on July 01, 2005, 09:14:37 AM
Hmmmm... I did follow all steps.. two times now, but it is not working correctly. (when including the second part of the mod to enamble users to edit their gender settings)
I don't know much about php, but somehow the code gets confused with one part of it still using m,f,g as the values, while the other part uses numbers as the values to store in the DB for determing the users gender...
Can someone please rewrite this to one clean mod?
Title: Re: Mini MOD: User GIS
Post by: Stoleti on January 11, 2006, 12:10:56 AM
how the user gender show in image comments (before username )

{user_sex} username ???
Title: Re: Mini MOD: User GIS
Post by: TheOracle on January 11, 2006, 12:43:45 PM
Hum, I think it's the first time I post on this topic.

However, I found two unusual paths :

Quote

$user_sex = "<img src=\"templates/default/images/".htmlspecialchars($user_row['user_sex']).".gif\">".$var_name." ";


as a generic case, it should be like :

Quote

$user_sex = "<img src=\"".get_gallery_image(htmlspecialchars($user_row['user_sex'])).".gif\">".$var_name." ";


;)

There's also another "default" path pointed from above the first post on this topic (as well)

which is this one :

Quote

<img src="templates/default/images/{user_sex}.gif">


let's modify this line a little bit.

In your member.php file,

find :

Quote

if ($config['account_activation'] == 2 && $user_info['user_level'] != ADMIN) {
    $edit_profile_msg .= $lang['edit_profile_email_msg_admin'];
  }

  $site_template->register_vars(array(
    "user_name" => htmlspecialchars(stripslashes($user_name)),   


add "right" below :

Code: [Select]

"user_sex_image" = get_gallery_image(htmlspecialchars($user_row['user_sex'])).".gif;


Then, replace the original line from your member_profile.html file

with this one :

Code: [Select]

{if user_sex_image}<img src="{user_sex_image}">{endif user_sex_image}


Now, you can use this tag with "all your templates" rather than just the default template. ;)
Title: Re: Mini MOD: User GIS
Post by: Stoleti on January 12, 2006, 12:00:48 AM
but i mean for image comments, not for member profile ....  :roll:
Title: Re: Mini MOD: User GIS
Post by: TheOracle on January 12, 2006, 01:28:24 AM
Did you tried with : {user_gender} ? ;)
Title: Re: Mini MOD: User GIS
Post by: Stoleti on January 12, 2006, 03:13:51 AM
yes i've :)

my doubts its about this is just about member.php and member_profile , for comments maybe details.php and comment_bit ???

 :?:
Title: Re: Mini MOD: User GIS
Post by: martrix on February 20, 2006, 11:05:46 AM
There's also another "default" path pointed from above the first post on this topic (as well)

You're doing a good job "ironing out" the paths in mods,
but remember, that some graphics are the same on different templates - therefore I have
all flags/gender signs etc. stored in the "default" template, no matter what
template is set actually...
Title: Re: Mini MOD: User GIS
Post by: trez on February 26, 2006, 01:30:57 PM
moved/

So, today a user of my site asked me about that, and i think too that this would be a good idea (when you have 20+ users online at the same time)

That would work of course just if user GIS mod is installed: Female usernames shown in red and male names in blue, so the orientation would be much better.

what do you think about that?

greetings

georgi
Title: Re: Mini MOD: User GIS
Post by: V@no on February 26, 2006, 07:06:40 PM
Lets see, asuming your have the default code for "whos online" section in includes/sessions.php. Then find:
Code: [Select]
  $sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible")."At the end of that line add:
Code: [Select]
, u.user_sex
The end result should be:[qcode]  $sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible").", u.user_sex[/qcode]

Then find:
Code: [Select]
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;Replace with:
Code: [Select]
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\" class=\"wosex".$row['user_sex']."\">".$username."</a>".$invisibleuser;
Then in style.css stylesheet add three new classes with needed coolors and such:
Code: [Select]
.wosex { /*no sex*/
}
.wosexm { /* male */
  color: red;
}
.wosexw { /* female */
  color: blue;
}
In some cases because the stylesheed for links could override this style, you'll need use this type of naming instead:
.wosex:visited, .wosex:link, .wosex:active
Title: Re: Mini MOD: User GIS
Post by: trez on February 26, 2006, 10:33:00 PM
thanks for that addon, but when i make the changes, i have displayed 0 users and 0 guests online instead of th real number.
I have the countryflags mod installed, can there be the problem?

georgi
Title: Re: Mini MOD: User GIS
Post by: V@no on February 26, 2006, 10:59:29 PM
I have the countryflags mod installed, can there be the problem?
Most probably.
Title: Re: Mini MOD: User GIS
Post by: trez on February 26, 2006, 11:01:09 PM
o no, the problem was becaus the table is user_gender instead of user_sex , so now i have no errors, but also no colors. Stays always the same gray  :?
Title: Re: Mini MOD: User GIS
Post by: PartyPix on April 20, 2006, 01:52:43 PM
Hi
i have 2 problems.
1.) I Have installed this mini MOD but if i go to the member_profile site. i see a mini black field with white border but not the images sex.

Here is a screen.

(http://funchecks.fu.funpic.de/profil1.JPG)


2.) In ACP I see only Ja / Nein (Yes / Not) for the gender and not weiblich / männlich (female / male)

How can i change this 2 problems ? I use 4images 1.7.2.



Here are the code that i have fill in the files.

db_field_definitions.php
Code: [Select]
$additional_user_fields['sex'] = array($lang['sex'], "radio", 1);


register_form.html
Code: [Select]
<tr>
            <td class="row2"><b>{lang_sex}</b></td>
            <td class="row2" width="20"><input type="radio" name="sex" value="m" checked />m&auml;nnlich&nbsp;&nbsp;&nbsp;
             <input type="radio" name="sex" value="w" />weiblich</td>
          </tr>

member_profile.html
Code: [Select]
<tr>
     <td class="row2"><nobr><b>{lang_sex}</b></nobr></td>
     <td class="row2"><img src="templates/default/images/{sex}.gif" width="14">
</td>
    </tr>


Here is a image of my databse entry,too but i think that is correct.

(http://funchecks.fu.funpic.de/db.JPG)
Title: Re: Mini MOD: User GIS
Post by: martrix on April 20, 2006, 04:38:35 PM
1.) I Have installed this mini MOD but if i go to the member_profile site. i see a mini black field with white border but not the images sex.
Did you set the gender-entry in the MySQL database for "Marcel W" and all other users?
If not, see here (http://www.4homepages.de/forum/index.php?topic=6000.msg26124#msg26124), how to do that.
Check also the path to the "broken" image - if it isn't coded to a inexisting file or if it isnt just smt like ".../.gif"
Title: Re: Mini MOD: User GIS
Post by: PartyPix on April 21, 2006, 11:49:11 AM
Quote
Did you set the gender-entry in the MySQL database for "Marcel W" and all other users?
If not, see here, how to do that.
Check also the path to the "broken" image - if it isn't coded to a inexisting file or if it isnt just smt like ".../.gif"

Hey that reply help me but it show only male symbols and if i got to the admin area, search for users when stand there:

gender :     yes    no x

(x mean that is checked)

When i click on yes i have the same problem how in the past. When i click in no after i click on yes i have the problem,too. Only if i make the step how V@no describe on a other post it will be go.

What is the problem ? And why stand in the ACP yes / no and not male / female ?
Title: Re: Mini MOD: User GIS
Post by: PartyPix on May 08, 2006, 07:02:11 PM
Hi all again.   

//// ENGLISH \\\\
I have my problem every,too. Please Help me. I try so much but it dont will be work. I try to explain again.

First when i make a new additinonal field i cant make user_xxxx. It dont will be work. So i try onlly xxxx and it will work. that is not the problem i think, but now. When i register a user and will check m i think it will go, but when i check w (female)  the script write in the database 0 and no image will be show in the member_profile. I have make the Update at first,too. So when i try to make the value in the radio buttons (in teh register page) to set 0 for w and 1 for m. But it dont will be go. Another little problem is that in the ACP it will be show Yes or Not and NOT Male / Female. Please Help me. I use version 1.7.2.


//// DEUTSCH \\\\

Hallo ich versuche nochmal mein Problem zu beschreiben. Als erstes Problem habe ich das ich nicht in einem additional field the table prefix user_sex machen kann sondern nur sex. (    $additional_user_fields['sex'] = array($lang['sex'], "radio", 1);   ). Das ist nicht das Problem, da es bei den anderen Feldern auch so funktioniert hat ohne dem user_. Nun zum eigentlichen Problem. When ich einen neunen User registriere und auf männlich klicke zeigt er meistens das männliche Symbol richtig an. Kllicke ich nun aber auf weiblich speichert er in der DB eine 0 und zeigt nur ein kleines Kästchen an. Nun dachte ich änder ich einfach den value wert in der register_form page statt für männlich value="m" habe ich value="1" und für weiblich value="0" geschrieben. Ging aber auch nicht. Habe auch die Bilder 0 udn 1 genannt. Ging alles nicht. Langsam weiß ich echt nicht merh weiter. Desweiteren (das kleinste Problem) wird im ACP nir unter Usereinstellungen männlich / weiblich angezeigt sondern nur Ja / Nein. Hat irgendjemand eine Idee woran das lieg? Hatte jemand auch diese Problem ? Bitte helft mir ! Ich benutze Version 1.7.2
Title: Re: Mini MOD: User GIS
Post by: martrix on May 21, 2006, 02:04:35 PM
im ACP sollte eigentlich nich "ja/nein" stehen, sondern männlich weiblich... oder besser nur der text m/w(/b falls hermafroditen erlaubt sin ;) )

Title: Re: Mini MOD: User GIS
Post by: PartyPix on May 26, 2006, 10:52:02 AM
Hallo matrix

Sorry war bis heute im Krankenhaus und konnte nicht antworten. Ja in der DB ist alles swoeit richtig eingestellt und ich habe auch alles auf "sex" geändert. Könntest du dir das eventuell anschauen und mir bei diesem Problem helfen ?
Wäre echt nett ;)

Title: Re: Mini MOD: User GIS
Post by: Sir Sky-Walker on May 26, 2006, 01:08:11 PM
Hi,

I have Installed the Mod. When I put in Database manuell m or w all works fine.
Butt when I make a new user, the mod set auto the user_sex field with"0". Not "m" or "w".

Can anybody help me?

----------------------

Hallo,

Habe gerade den Mod installiert. Funktionier soweit alles bestens. Wenn ich in der Datenbank selbst "m" oder "w" beim user eingebe, wird alles perfekt angezeigt.

Sobal ich mich aber neu anmelde auf meiner Seite, also ein neuer User erstellt wird, setzt er in der Datenbank das Feld user_sex auf "0" und das gibs ja nciht!

warum ???
Title: Re: Mini MOD: User GIS
Post by: ccsakuweb on August 29, 2006, 10:48:56 PM
Thanks! This mod is too great!!

In your member.php file,

find :

Quote

if ($config['account_activation'] == 2 && $user_info['user_level'] != ADMIN) {
    $edit_profile_msg .= $lang['edit_profile_email_msg_admin'];
  }

  $site_template->register_vars(array(
    "user_name" => htmlspecialchars(stripslashes($user_name)),   


add "right" below :

Code: [Select]

"user_sex_image" = get_gallery_image(htmlspecialchars($user_row['user_sex'])).".gif;


Then, replace the original line from your member_profile.html file

with this one :

Code: [Select]

{if user_sex_image}<img src="{user_sex_image}">{endif user_sex_image}


Now, you can use this tag with "all your templates" rather than just the default template. ;)

If i do this changes my memberprofile have an error, i see all it in white colour.. I think that it is because I have in my member.php the next code :
Code: [Select]
$site_template->register_vars(array(
    "user_name" => format_text(stripslashes($user_name), 2),
and not the next that i can to find..
Code: [Select]
    "user_name" => htmlspecialchars(stripslashes($user_name)),    maybe i could add below something like the next code???  I don't know php so please help me :(
Code: [Select]
"user_sex_image" = get_gallery_image(format_text(stripslashes($user_row['user_sex'], 2).".gif;),     
Title: Re: Mini MOD: User GIS
Post by: keksoid on October 23, 2006, 12:56:08 PM
At me a problem, has made all as was написанно in the instruction, but alas does not work.

I have version 1.7.1.

Here what mistake{error} turns out

DB Error: Bad SQL Query: UPDATE 4images_users SET user_email = ' konkor2001@mail.ru ', user_showemail = 1, user_allowemails = 1, user_invisible = 0, user_homepage = ' http://my-mobiles.net ', user_icq = ' 76833206 ', = ' 2 ', birthday = ' 2006-02-22 ', user_pm_email = ' 1 ', user_pm_popup = ' 1 ' WHERE user_id = 995
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' = ' 2 ', birthday = ' 2006-02-22 ', user_pm_email = ' 1 ', user_pm_popup = ' 1 ' ' at line 2

Whether correctly I have written this line

$sql = "UPDATE" .USERS_TABLE. "
            SET " .get_user_table_field (" "," user_email "). " = ' $user_email ', " .get_user_table_field (" "," user_showemail "). " = $user_showemail, " .get_user_table_field (" "," user_allowemails "). " = $user_allowemails, " .get_user_table_field (" "," user_invisible "). " = $user_invisible, " .get_user_table_field (" "," user_homepage "). " = ' $user_homepage ', " .get_user_table_field (" "," user_icq "). " = ' $user_icq ', " .get_user_table_field (" "," user_sex "). " = ' $user_gender ' ". $additional_sql. "
Title: Re: Mini MOD: User GIS
Post by: UFOSWORLD on June 12, 2007, 09:42:31 PM
Könnte man die Änderungserweiterung nochmal so zusammenfassen, das nicht jeden dritten Post eine besser Version aufgezeigt wird...

wollte das nämlich einbauen und nicht 15 mal jede Dati editieren, weil drei posts später eine kürzere Version kommt... 

desweiteren wäre eventl hilfreich in welchen Dateien die Änderungen zu erfolgen haben... hiervon steht nämlich nichts dabei

grüsse
Title: Re: Mini MOD: User GIS
Post by: sidharth186 on August 09, 2008, 01:54:30 AM
Hi !!

I am a newbie to 4images but can still understand your MOD for user gender.

I appreciate your MOD ...

But I am stuck up at this point:

"But if you use MOD Memberlist, try this too:"

Can you please tell me what this means and where should I find the Code next to this?

I wanted to see the Gender of the users in the Admin Control Panel as well, which is not visible after completion of the steps till this point. So I think I need to carry out some more steps.

Please help me out on this , I would be highly thankful to you :)

Sidharth
Title: Re: Mini MOD: User GIS
Post by: sidharth186 on August 10, 2008, 10:48:57 AM
Post updated on: 19 June 2003, 03:21am
Quote from: spoiledRHOtten
Hi!

Okay...my question is this...if we set the user to default as "male" is there a way for them to change it?
There is but it's going to require a few changes to the original mod.

First open: includes/db_field_definitions.php

Find:
Code: [Select]
$additional_user_fields['user_sex'] = array($lang['user_sex'], "radio", 1);Change to:
Code: [Select]
$additional_user_fields['user_sex'] = array($lang['user_sex'], "text", 0);
Open: member.php

Find:
Code: [Select]
   else {
      $user_icq_button = REPLACE_EMPTY;
    }
Below add:
Code: [Select]
// User Gender Switch
$gender_array = array("Male", "Female", "None Specified");
$user_gender = $gender_array[$user_row['user_sex']]." <img src=\"".TEMPLATE_PATH."/images/gender".$user_row['user_sex'].".gif\">";
Rename images to gender0.gif = male gender1.gif = female and gender3.gif = blank (nothing)

Find:
Code: [Select]
     "lang_email" => $lang['email'],
      "lang_homepage" => $lang['homepage'],
      "lang_icq" => $lang['icq']
Change to:
Code: [Select]
     "lang_email" => $lang['email'],
      "lang_homepage" => $lang['homepage'],
      "lang_icq" => $lang['icq'],
 "user_gender" => $user_gender,
Find:
Code: [Select]
   $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'
Change to:
Code: [Select]
   $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq', user_sex = '$user_gender'
Find:
Code: [Select]
 if ($config['account_activation'] == 2 && $user_info['user_level'] != ADMIN) {
    $edit_profile_msg .= $lang['edit_profile_email_msg_admin'];
  }
Below add:
Code: [Select]
// User Gender Switch
if($user_info['user_sex'] == 1){
$user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\" checked />
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\" />
              female</font>";
} else if($user_info['user_sex'] == 2){
$user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\"/>
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\" checked  />
              female</font>";
} else {
$user_gender = "<input type=\"radio\" name=\"user_gender\" value=\"1\"/>
              male&nbsp;&nbsp;&nbsp;
              <input type=\"radio\" name=\"user_gender\" value=\"2\"/>
              female</font>";
}
Find:
Code: [Select]
   "lang_edit_profile_msg" => $edit_profile_msg,
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no']
Replace with:
Code: [Select]
   "lang_edit_profile_msg" => $edit_profile_msg,
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no'],
"user_gender" => $user_gender,
Open: templates/default/member_editprofile.html

Find:
Code: [Select]
         <tr>
            <td class="row1"><b>{lang_invisible}</b></td>
            <td class="row1"> <input type="radio" name="user_invisible" value="1"{user_invisible_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp; <input type="radio" name="user_invisible" value="0"{user_invisible_no} />
              {lang_no} </td>
          </tr>
Below add:
Code: [Select]
         <tr>
            <td class="row2"><b>Gender</b></td>
            <td class="row2">{user_gender}</td>
          </tr>
Open: templates/default/member_profile

Find:
Code: [Select]
<img src="templates/default/images/{user_sex}.gif">Remove it.

Find:
Code: [Select]
       <tr>
          <td class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://wwp.icq.com/scripts/search.dll?to={user_icq}">{user_icq}</a>
            (<b>{user_icq_status}</b>){endif user_icq}</td>
        </tr>
Below add:
Code: [Select]
       <tr>
          <td class="row1"><b>Gender</b></td>
          <td class="row1">{user_gender}</td>
        </tr>

Thats about it I think, Save and close the files. I have tested on a fresh install of 4images and it works great.

Please inform me of any problems.

Carl

Please help I have completed all the instructions succesfully but the ACP still shows Yes and No instead of Male, Female, Both