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: Admin Name Color?  (Read 2827 times)

0 Members and 1 Guest are viewing this topic.

SirMoo

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Admin Name Color?
« on: April 24, 2011, 10:14:27 am »

I did do a bit of searching before hand, but there seems to be a lot of things cluttering the forum and 'admin' just adds too many useless things to the mix. If this is discussed elsewhere, please point me in the right direction.

When viewing comments, I'd like for administrators names to be shown in color (that is different from normal users), is there a way to do this? I've noticed that it appears to treat them all the same regardless. Is there an easy way to change this? Can I make it distinguish between admin and normal members? Either by CSS or else where? I use a modified version of Hardwired if that helps.

Thanks!

-SirMoo-
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Admin Name Color?
« Reply #1 on: April 26, 2011, 02:25:53 pm »

Copy function theme_html_comments from themes/sample/theme.php to your theme's theme.php file, if it doesn't exist.

Then, find
Code: [Select]
                $profile_lnk = '<a href="profile.php?uid='.$row['author_id'].'">'.stripslashes($row['msg_author']).'</a>';and replace with
Code: [Select]
                $has_admin_access = mysql_result(cpg_db_query("SELECT has_admin_access FROM {$CONFIG['TABLE_USERGROUPS']} AS g INNER JOIN {$CONFIG['TABLE_USERS']} AS u ON g.group_id = u.user_group WHERE user_id = {$row['author_id']}"), 0);
                $admin_color = $has_admin_access ? 'style="color:red;"' : '';
                $profile_lnk = '<a href="profile.php?uid='.$row['author_id'].'" '.$admin_color.'>'.stripslashes($row['msg_author']).'</a>';
Logged

SirMoo

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Admin Name Color?
« Reply #2 on: April 26, 2011, 03:05:16 pm »

This appears to have worked perfectly! Thank you so much!
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.