View Full Version : Show a user's group membership
Snake
01-30-2006, 07:33 PM
How do I display a user's group membership title (or name) in postbit? I coudn't figure it out how to do it. Is there someone who can help me up with this please?
Snake
02-01-2006, 11:42 AM
*bumps*
Anyone?
Snake
02-05-2006, 03:35 PM
*bumps*
ZombieAndy
02-05-2006, 09:36 PM
in the postbit (or postbit legacy depending which you use) template find:
<if condition="$show['avatar']">
<div class="smallfont">
<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>
</if>
and below it add:
<if condition="$post['usergroupid']==6"><div class="smallfont"><b>Administrator</b></div></if>
<if condition="$post['usergroupid']==5"><div class="smallfont"><b>Super Moderator</b></div></if>
<if condition="$post['usergroupid']==7"><div class="smallfont"><b>Moderator</b></div></if>
<if condition="$post['usergroupid']==8"><div class="smallfont"><b>Banned</b></div></if>
<if condition="$post['usergroupid']==2"><div class="smallfont"><b>Member</b></div></if>
changing the user group ID's to match your own. you'll find them in the usergroup manager.
:)
photongbic
02-24-2006, 07:41 PM
This works great if you are checking for a primary usergroup but how do you check if they have an additional membership to a custom group?
For example, the user is in the "Registered Users" group (id=2) and the "Furry Friends" group (id=10). "Registered Users is their primary group. I wish to show that they are in both groups. How do I do that?
In the above example, the code would be changed from...
This works for primary group
<if condition="$post['usergroupid']==10"><div class="smallfont"><b>Furry Friends</b></div></if>
to...
This works for all groups
<if condition="is_member_of($post,10)"><div class="smallfont"><b>Furry Friends</b></div></if>
Have fun!
nader
11-26-2006, 10:56 AM
*bumps*
ErikTheRed
11-27-2006, 06:36 AM
photongbic:
Thank you! The "is_member_of" function is exactly what I have been looking for all night. I used it to display a badge for VIP members who have a paid subscription.
jluerken
11-27-2006, 09:23 AM
This can be done without any code changes using the USER RANKS option.
Add user ranks that reflect your usergroups and set them on SHOW.
This should also work without having the need to edit templates. :-)
ErikTheRed
11-27-2006, 09:43 AM
Nice - thanks jluerken. Didn't even think of that. No template changes is much better.
stan111
02-01-2007, 12:44 AM
image please?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.