forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: SirMoo on April 24, 2011, 10:14:27 am

Title: Admin Name Color?
Post by: SirMoo 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-
Title: Re: Admin Name Color?
Post by: Αndré 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>';
Title: Re: Admin Name Color?
Post by: SirMoo on April 26, 2011, 03:05:16 pm
This appears to have worked perfectly! Thank you so much!