Author Topic: [MOD] User GIS  (Read 88029 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Mini MOD: User GIS
« Reply #15 on: June 18, 2003, 02:12:52 PM »
are u sure? its working for me. just tryed on test file.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
Mini MOD: User GIS
« Reply #16 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?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Mini MOD: User GIS
« Reply #17 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) {
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
Mini MOD: User GIS
« Reply #18 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Mini MOD: User GIS
« Reply #19 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>
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
Mini MOD: User GIS
« Reply #20 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:

Offline spoiledRHOtten

  • Newbie
  • *
  • Posts: 42
    • View Profile
Mini MOD: User GIS
« Reply #21 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!

Offline spoiledRHOtten

  • Newbie
  • *
  • Posts: 42
    • View Profile
Mini MOD: User GIS
« Reply #22 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.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Mini MOD: User GIS
« Reply #23 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
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline spoiledRHOtten

  • Newbie
  • *
  • Posts: 42
    • View Profile
Mini MOD: User GIS
« Reply #24 on: June 19, 2003, 03:49:05 AM »
okay...where should I add it?

Offline uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
Mini MOD: User GIS
« Reply #25 on: June 19, 2003, 03:59:10 AM »
Quote from: spoiledRHOtten
okay...where should I add it?


user_sex = '$user_gender

Offline spoiledRHOtten

  • Newbie
  • *
  • Posts: 42
    • View Profile
Mini MOD: User GIS
« Reply #26 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.

Offline uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
Mini MOD: User GIS
« Reply #27 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.

b.o.fan

  • Guest
Re: Mini MOD: User GIS
« Reply #28 on: March 17, 2005, 11:10:42 PM »
hat somebody gender-gif pics for me??

 :D :D

Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: Mini MOD: User GIS
« Reply #29 on: March 20, 2005, 07:22:45 PM »
yes somebody "hat" ;)




and the most important:



MAяTRIX