Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Removing field Occupation from My Profile  (Read 2528 times)

0 Members and 1 Guest are viewing this topic.

korn

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Removing field Occupation from My Profile
« on: May 02, 2004, 11:54:41 am »

How can I remove a field like "Occupation" from "My profile"?
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Removing field Occupation from My Profile
« Reply #1 on: May 02, 2004, 06:22:39 pm »

Easy way.  This will enable you to change 'Occupation' to field of your choice, or leave it blank.;

Open your language file, and find;

Code: [Select]
'occupation' => 'Occupation',  
and
Code: [Select]
'user_occupation' => 'User occupation',
In both cases, change the 2nd bit to
Code: [Select]
=> ''
Or put your new name for the field here.


Hard way.  This removes the field altogether. Back up these files first.

Open register.php, and find;

Code: [Select]
array('input', 'occupation', $lang_register_php['occupation'], 255),and
Code: [Select]
$occupation = addslashes(get_post_var('occupation'));
Comment them out (or delete them)

Now find;

Code: [Select]
$sql = "INSERT INTO {$CONFIG['TABLE_USERS']} " . "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_location, user_interests, user_website, user_occupation) " . "VALUES (NOW(), '$active', '$act_key', '" . addslashes($user_name) . "', '" . addslashes($password) . "', '" . addslashes($email) . "', '$location', '$interests', '$website', '$occupation' )";
and change it to;

Code: [Select]
$sql = "INSERT INTO {$CONFIG['TABLE_USERS']} " . "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_location, user_interests, user_website) " . "VALUES (NOW(), '$active', '$act_key', '" . addslashes($user_name) . "', '" . addslashes($password) . "', '" . addslashes($email) . "', '$location', '$interests', '$website')";

Now open profile.php, and comment out or delete the following;

Code: [Select]
array('input', 'occupation', $lang_register_php['occupation'], 255),
and

Code: [Select]
array('text', 'occupation', $lang_register_php['occupation']),
and

Code: [Select]
$occupation = get_post_var('occupation');
and

Code: [Select]
'occupation' => $user_data['user_occupation'],
Note, the last 1 is there 2 times, delete both.

Now find;

Code: [Select]
$sql = "UPDATE {$CONFIG['TABLE_USERS']} SET " . "user_location = '$location', " . "user_interests = '$interests', " . "user_website = '$website', " . "user_occupation = '$occupation' " . "user_profile1 = '$profile1' " . "user_profile2 = '$profile2' " . "user_profile3 = '$profile3' " . "user_profile4 = '$profile4' "  . "WHERE user_id = '" . USER_ID . "'";
and change it to;

Code: [Select]
$sql = "UPDATE {$CONFIG['TABLE_USERS']} SET " . "user_location = '$location', " . "user_interests = '$interests', " . "user_website = '$website', " . "user_profile1 = '$profile1' " . "user_profile2 = '$profile2' " . "user_profile3 = '$profile3' " . "user_profile4 = '$profile4' "  . "WHERE user_id = '" . USER_ID . "'";
Now find;

Code: [Select]
$sql = "SELECT user_name, user_email, user_group, UNIX_TIMESTAMP(user_regdate) as user_regdate, group_name, " . "user_location, user_interests, user_website, user_occupation, user_profile1, user_profile2, user_profile3, user_profile4, user_lang as user_group_list, " . "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_quota " . "FROM {$CONFIG['TABLE_USERS']} AS u " . "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group = group_id " . "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.owner_id = u.user_id " . "WHERE user_id ='" . USER_ID . "' " . "GROUP BY user_id ";
and change it to;

Code: [Select]
$sql = "SELECT user_name, user_email, user_group, UNIX_TIMESTAMP(user_regdate) as user_regdate, group_name, " . "user_location, user_interests, user_website, user_profile1, user_profile2, user_profile3, user_profile4, user_lang as user_group_list, " . "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_quota " . "FROM {$CONFIG['TABLE_USERS']} AS u " . "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group = group_id " . "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.owner_id = u.user_id " . "WHERE user_id ='" . USER_ID . "' " . "GROUP BY user_id ";
Finally, find;

Code: [Select]
$sql = "SELECT user_name, user_email, UNIX_TIMESTAMP(user_regdate) as user_regdate, group_name, " . "user_location, user_interests, user_website, user_occupation, user_profile1, user_profile2, user_profile3, user_profile4" . "FROM {$CONFIG['TABLE_USERS']} AS u " . "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group = group_id " . "WHERE user_id ='$uid'";
and change it to;

Code: [Select]
$sql = "SELECT user_name, user_email, UNIX_TIMESTAMP(user_regdate) as user_regdate, group_name, " . "user_location, user_interests, user_website, user_profile1, user_profile2, user_profile3, user_profile4" . "FROM {$CONFIG['TABLE_USERS']} AS u " . "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group = group_id " . "WHERE user_id ='$uid'";
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

korn

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Removing field Occupation from My Profile
« Reply #2 on: May 02, 2004, 07:32:37 pm »

Casper, thank you very much! The field is gone.

One more question about My Profile. How come a user itself cannot change his or her ema-il address?
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Removing field Occupation from My Profile
« Reply #3 on: May 02, 2004, 07:47:08 pm »

I'm not sure this is why, but I think it's to stop malicious users registering, then immediately changing their email so they can't be traced.  If they want to change for genuine reasons, email to the admin who can do it for them.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Removing field Occupation from My Profile
« Reply #4 on: May 02, 2004, 10:35:50 pm »

Casper's right by guessing it's to prevent abuse. There'll be an a admin switch in future versions (at least it's on my todo list) that will say "allow user to change email address[Yes]/[No]".

GauGau
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.