Group Username Colors Group Username Colors
 

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

Main Menu

Group Username Colors

Started by Super Noodles, October 31, 2008, 08:52:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Super Noodles

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 ;)

Joachim Müller

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        $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)        $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'group' => $user_data['group_name'] . $group_list,and replace with'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.