Hello

I am trying to improve my drupal 4.7.4 website by making nodes and comments show the role of the user that created it, such as :

posted by John (admin)
posted by Joe (regular user)

I couldn't find a solution searching in the forums.

thanks
Leo

Comments

cog.rusty’s picture

A problem is that a user can have many roles.

Roles in Drupal are not like badges and they have no hierarchy. Of course you could list all of them or pull a random one, but that wouldn't make sense. Maybe an additional field in their profile would serve better than roles.

mcfly-1’s picture

Yes, but my idea is to give each user one role only, and just show one role. I thought about creating a custom field in profile, but I'd like to really use the roles in order to promote my most loyal users and showing their role next to their posts might be cool.

Any ideas how I could do that ?

thanks
Leo

cog.rusty’s picture

I don't know how to do it but there is a user badges module (http://drupal.org/project/user_badges) which you might find interesting. It assigns badges either automatically by role(s) or manually.

mcfly-1’s picture

Thanks you. This module is working great on my website.

regards,
Leo

armanjava’s picture

Can you create user lists and views based on the user badges? I would like a directory for my users that shows all users and their associated user badge.

amnion’s picture

I am also looking for a way to display the badges. Like a node with all the different badges that shows all the users with that badge. I tried using the views modules, but nothing dealing with badges seems to come up.

cog.rusty’s picture

I can see a 6 months old feature request for views support in the user_budges issues queue. Maybe it would help if more people seconded the request or even better if someone submitted code for this.