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: Move profile custom fields  (Read 4599 times)

0 Members and 1 Guest are viewing this topic.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Move profile custom fields
« on: July 22, 2014, 10:00:10 am »

In users profile (profile.php?uid=...) first is displayed the Username ,Status ,Joined and then the custom fields I set in config.
Can I move the custom fields on top.
I want to have a custom field named avatar and users to embed an image.It must be first under someuser's profile to make sense.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Move profile custom fields
« Reply #1 on: July 22, 2014, 03:01:47 pm »

Please open profile.php and have a closer look at the following code block:
Code: [Select]
$display_profile_form_param = array(
    array('text', 'username', $lang_register_php['username']),
    array('text', 'status', $lang_usermgr_php['status']),
    array('text', 'reg_date', $lang_register_php['reg_date']),
    array('text', 'group', $lang_register_php['group'])
);
if ($CONFIG['user_profile1_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile1', $CONFIG['user_profile1_name']);
}
if ($CONFIG['user_profile2_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile2', $CONFIG['user_profile2_name']);
}
if ($CONFIG['user_profile3_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile3', $CONFIG['user_profile3_name']);
}
if ($CONFIG['user_profile4_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile4', $CONFIG['user_profile4_name']);
}
if ($CONFIG['user_profile5_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile5', $CONFIG['user_profile5_name']);
}
if ($CONFIG['user_profile6_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile6', $CONFIG['user_profile6_name']);
}
$display_profile_form_param[] = array('text', 'pic_count', $lang_register_php['pic_count']);
$display_profile_form_param[] = array('thumb', 'user_thumb');
$display_profile_form_param[] = array('text', 'admin_link', '');

That part determines the order of the different fields. Do you want to move all custom fields or just the avatar field to the top? Should the avatar be on top or below the user name?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Move profile custom fields
« Reply #2 on: July 22, 2014, 05:23:05 pm »

Thanks.I need to know what code determines the order of the different fields.

I replaced (to ungroup them):

Code: [Select]
$display_profile_form_param = array(
    array('text', 'username', $lang_register_php['username']),
    array('text', 'status', $lang_usermgr_php['status']),
    array('text', 'reg_date', $lang_register_php['reg_date']),
    array('text', 'group', $lang_register_php['group'])
);

with:

Code: [Select]
$display_profile_form_param[] = array('text', 'username', $lang_register_php['username']);
$display_profile_form_param[] = array('text', 'status', $lang_usermgr_php['status']);
$display_profile_form_param[] = array('text', 'reg_date', $lang_register_php['reg_date']);
$display_profile_form_param[] = array('text', 'group', $lang_register_php['group']);

and now I can move each field where I want.

Now the code looks like this (I only moved the first custom field under field username):

Code: [Select]
$display_profile_form_param[] = array('text', 'username', $lang_register_php['username']);
if ($CONFIG['user_profile1_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile1', $CONFIG['user_profile1_name']);
}
$display_profile_form_param[] = array('text', 'status', $lang_usermgr_php['status']);
$display_profile_form_param[] = array('text', 'reg_date', $lang_register_php['reg_date']);
$display_profile_form_param[] = array('text', 'group', $lang_register_php['group']);


if ($CONFIG['user_profile2_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile2', $CONFIG['user_profile2_name']);
}
if ($CONFIG['user_profile3_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile3', $CONFIG['user_profile3_name']);
}
if ($CONFIG['user_profile4_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile4', $CONFIG['user_profile4_name']);
}
if ($CONFIG['user_profile5_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile5', $CONFIG['user_profile5_name']);
}
if ($CONFIG['user_profile6_name'] != '') {
    $display_profile_form_param[] = array('text', 'user_profile6', $CONFIG['user_profile6_name']);
}
$display_profile_form_param[] = array('text', 'pic_count', $lang_register_php['pic_count']);
$display_profile_form_param[] = array('thumb', 'user_thumb');
$display_profile_form_param[] = array('text', 'admin_link', '');

Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Move profile custom fields
« Reply #3 on: July 22, 2014, 05:30:44 pm »

How wants to know this is a way for  coppermine user avatar or profile avatar.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Move profile custom fields
« Reply #4 on: July 24, 2014, 02:34:55 pm »

I can use bbcode only in custom profile number 6.
Why?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Move profile custom fields
« Reply #5 on: July 24, 2014, 07:46:32 pm »

Code: (profile.php) [Select]
    $form_data = array(
        'username'      => $user_data['user_name'],
        'status'        => $user_status,
        'reg_date'      => localised_date($user_data['user_regdate'], $lang_date['register']),
        'group'         => $user_data['group_name'],
        'user_profile1' => $user_data['user_profile1'],
        'user_profile2' => $user_data['user_profile2'],
        'user_profile3' => $user_data['user_profile3'],
        'user_profile4' => $user_data['user_profile4'],
        'user_profile5' => $user_data['user_profile5'],
        'user_profile6' => bb_decode($user_data['user_profile6']),
        'user_thumb'    => $quick_jump,
        'pic_count'     => cpgUserPicCount($uid),
        'admin_link'    => $adminLink,
    );

Feel free to wrap the other data in bb_decode().
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Move profile custom fields
« Reply #6 on: July 24, 2014, 07:55:37 pm »

Thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.