Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Group Username Colors  (Read 1223 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: 47844
  • 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.017 seconds with 19 queries.