forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Super Noodles on October 31, 2008, 08:52:22 pm

Title: Group Username Colors
Post by: Super Noodles on October 31, 2008, 08:52:22 pm
Hi guys,

I've searched and found how to change the usergroup colors in Who's Online Plugin but I want to know how I can make the color show in my Profile page.

Thanks ;)
Title: Re: Group Username Colors
Post by: Joachim Müller on November 01, 2008, 11:14:58 am
The profile can be seen in several view modes - you failed to specify which one you want to see changed, so my instructions below apply to what a user see when clicking on the "my profile" link from the menu.
Edit profile.php, find
Code: [Select]
        $form_data = array('username' => $user_data['user_name'],
            'reg_date' => localised_date($user_data['user_regdate'], $register_date_fmt),
and add before it (into a new line)
Code: [Select]
        $group_color = array('Registered' => 'blue', 'Administrators' => 'red', 'your custom group name' => 'pink');and modify that line as you see fit (you can use color names or any valid color code like '#FF0000'). If you have more groups, add them to the array. The logic in the array is 'custom group name' => 'color'.
Next, find
Code: [Select]
'group' => $user_data['group_name'] . $group_list,and replace with
Code: [Select]
'group' => '<span style="color:'.$group_color[$user_data['group_name']].'">'.$user_data['group_name'].'</span>' . $group_list,. Upload the edited file and test it. Take a note of the mod, as you will have to re-apply it each time you perform an update.