Admin Name Color? Admin Name Color?
 

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

Admin Name Color?

Started by SirMoo, April 24, 2011, 10:14:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SirMoo

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-

ΑndrĂ©

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

Then, find
                $profile_lnk = '<a href="profile.php?uid='.$row['author_id'].'">'.stripslashes($row['msg_author']).'</a>';
and replace with
                $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>';

SirMoo

This appears to have worked perfectly! Thank you so much!