By NeoID on
Hi,
Is there a module or easy way to assign a color to a role/group/rank so that all members of that group or rank have a special colored username?
Hi,
Is there a module or easy way to assign a color to a role/group/rank so that all members of that group or rank have a special colored username?
Comments
_
No module that I know of, but you can do it pretty easily. Override the theme_username function in your template.php file and style however you wish.
That would mean I'll have to
That would mean I'll have to hardcode either the username or role to a specific color.. not a very good solution... :/
There is a new feature at
There is a new feature at http://drupal.org/project/realname where you can add an image to each role ..
see http://drupal.org/node/388928
_
I'm not sure I understand-- do you want the user to be able to change the color or something?
I want to be able to do the
I want to be able to do the same as you can on every other modern forum; create a group, add members and (as an admin) give certain groups a special colored username...
_
Maybe http://drupal.org/project/user_badges is close to what you want? Otherwise, I still think theme_username is the way to go-- you can put any php you want there, so you can assign classes based on user roles then style/color them in css any way you like. You can also limit it to forum posts or let it follow the user throughout the site.
I've figured out that the
I've figured out that the below code works, but I'm trying to clean it up a bit and add a switch/case in order to check for more user roles.
So... I want to check if the user role is Moderator and if yes add a div-wrapper "moderator-role", but if the role is for example "Event" it should add a div with a class called "event-role"...
Anyone who knows how to clean it up a bit, it looks really messy if I copy/paste it for every user-role I want to check...
I found a nice way to do
I found a nice way to do this, however, instead of printing the role for the user currently logged in, how can I modify it in order to affect the current member (in the theme_username function)?