if user role = role then display a image??

demon326@drupal.org - February 18, 2008 - 16:48

Hello all, i'm working on a new project and i want to theme my comment with comment.tpl.php but thats not the problem, i want to putput a certain image like "Crew" if the user role is "crew"... a live example is here:
http://www.9lives.be/cartoon/106974

check out the 3rd comment

in the past i contacted the site admin and he has given me the code but i lost the mail wit it so i'm comming to ask here for help..

ps: 9lives us using drupal (h)

I believe it would be best

TapocoL - February 18, 2008 - 18:28

I believe it would be best to complete this with a custom module using hook_comment.
http://api.drupal.org/api/function/hook_comment/6

Just check in_array('crew role') of $user->roles
Change crew role to whatever role you create for the crew.

-Craig Jackson
-Web Developer

Can you suggest an alternative for non-coders?

dccircuit - February 3, 2009 - 01:20

I'm not quite savvy enough to develop my own module, can you suggest any other methods that might make this work?

I tried to implement a solution where I put a custom user avatar up for anyone that was a person with a specific user role and then used avatarapproval module to allow those particular avatars, but the problem is that if someone later downloads and re-uploads that same avatar for their account, it's automatically approved because it had previously been approved.

Hmmm.

(Running Drupal 5, by the way).

 
 

Drupal is a registered trademark of Dries Buytaert.