coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: allvip on July 22, 2014, 10:00:10 AM

Title: Move profile custom fields
Post by: allvip 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.
Title: Re: Move profile custom fields
Post by: Αndré on July 22, 2014, 03:01:47 PM
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?
Title: Re: Move profile custom fields
Post by: allvip 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):


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


Title: Re: Move profile custom fields
Post by: allvip on July 22, 2014, 05:30:44 PM
How wants to know this is a way for  coppermine user avatar or profile avatar.
Title: Re: Move profile custom fields
Post by: allvip on July 24, 2014, 02:34:55 PM
I can use bbcode only in custom profile number 6.
Why?
Title: Re: Move profile custom fields
Post by: Αndré 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().
Title: Re: Move profile custom fields
Post by: allvip on July 24, 2014, 07:55:37 PM
Thanks.