PDA

View Full Version : Automatically display certain value in user profile depending on usergroup


msmayz
06-03-2014, 05:26 PM
Hi guys. How can I create a custom user profile field that will automatically display a certain value based on the member's usergroup?

For instance, let's say I have three usergroups: Registered Users (id 2), Custom Group A (id 9), and Custom Group B (id 10). And let's say I want to have a custom user profile field labeled Animal. I want all members in usergroup 2 to automatically show "Owl" in that field; usergroup 9 to show "Rabbit"; and usergroup 10 to show "Monkey." I also want this field to automatically update when members get promoted, so a member who is promoted from usergroup 2 to usergroup 9 will see that this field in their profile has automatically changed from "Owl" to "Rabbit."

(For ease of comprehension, this is, obviously, a hypothetical version of what I want to do, but it functions exactly the same way.)

Any ideas?

Lynne
06-03-2014, 05:32 PM
Couldn't you use Ranks?

msmayz
06-04-2014, 01:31 AM
Hey Lynne! Thanks for your response. Is there a way to make Ranks appear on members' profile pages (like, below the Personal/Biography information) and not beneath their usernames on their posts?

Lynne
06-04-2014, 06:10 PM
Ranks do show on the member.php page. If you don't want them to show on the posts, then you could write a plugin using the postbit_display_complete hook location:


$post['rank']=false;

msmayz
06-05-2014, 03:33 AM
Thanks so much, Lynne! You're the best... no seriously. :)