Advanced search  

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

Pages: [1]   Go Down

Author Topic: Group Username Colors  (Read 1693 times)

0 Members and 1 Guest are viewing this topic.

Super Noodles

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Group Username Colors
« 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 ;)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Group Username Colors
« Reply #1 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.