Group Username Colors Group Username Colors
 

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

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.