Move profile custom fields Move profile custom fields
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Move profile custom fields

Started by allvip, July 22, 2014, 10:00:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

allvip

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.

Αndré

Please open profile.php and have a closer look at the following code block:
$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?

allvip

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

I replaced (to ungroup them):


$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:


$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):


$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', '');



allvip

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

allvip

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

Αndré

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().

allvip