Gossamer Forum
Quote Reply
Coloring of usernames
Has anyone built a plugin to color usernames of a certain group differently when displayed. For example all forum moderators names would higlight red instead of the default color. We are switching over to gossamer and our current system has this functionality.
Quote Reply
Re: [jzahn] Coloring of usernames In reply to
Not a plugin but here's what I did:

http://www.gossamer-threads.com/...orum.cgi?post=202590

Safe swoops
Sangiro
Quote Reply
Re: [sangiro] Coloring of usernames In reply to
Is there any way to do it other than when actually viewing the post. In particular on the category and forum list pages?

Also, for some reason I cannot seem to make anyone belong to the moderators group. When I view the groups I can see the moderators group, but when I try to add a user to it that group does not appear in the list of available groups.

Thanks for the help so far.
Quote Reply
Re: [jzahn] Coloring of usernames In reply to
Figured out how to add moderator's to a forum. Is there a way to give someone blanket moderator priveledges to all forums or do you have to assign them to each forum separately?
Quote Reply
Re: [jzahn] Coloring of usernames In reply to
This post may help you out. It concerns giving someone admin rights not for the admin panel but only for the forum :
http://www.gossamer-threads.com/...i?post=187369#187369

Jag
Significant Media
Quote Reply
Re: [Jag] Coloring of usernames In reply to
Thanks for all the help. I got the moderator coloring to work throughout our entire board, forum views and all. One more question. Is there a way to color users in a certain group. We want to color a certain group without giving them any special admin/mod privledges.
Quote Reply
Re: [jzahn] Coloring of usernames In reply to
I think having a different color setting assignable by the admin would make a nice addition / suggestion for another feature in the core script.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Coloring of usernames In reply to
I have this almost working now based on groups with the folowing handly little function (Thanks to the other Jason):

Code:


sub colorize_user {
my ($username, $user_id) = @_;

# if no user_id was passed look it up
if (!$user_id and $username) {
$user_id = $DB->table("User")->select(user_id => {user_username => $username})->fetchrow;
}

# now color
if ($user_id and $username) {
# Color OSI Staff group
if ($DB->table("UserGroup")->count({user_id_fk => $user_id, group_id_fk => 42 })) {
$username = qq|<span style="color:#990000; font:bold">| . GT::CGI::html_escape($username). qq|</span>|;
}
# Color Moderator group
elsif ($DB->table("UserGroup")->count({user_id_fk => $user_id, group_id_fk => 43 })) {
$username = qq|<span style="color:#009900; font:bold">| . GT::CGI::html_escape($username). qq|</span>|;
}
}
return "$username";
}


In my templates I use it like this:

<%colorize_user($forum_last_poster)%>

Problem is the html generated by the sub gets escaped before it's printed (< changes to &lt; and so on). So <span style="color:blah">User</span> just prints out instead of actually affecting the color of the text.

How do I keep this from happening?