PDA

View Full Version : Condition for IF part of usergroup, SHOW all?


Skyrider
01-21-2015, 09:08 AM
I've checked out the conditions, but I'm unable to find a condition that IF a user is in a specific usergroup, it shows something specific to EVERYONE. Not just those who are in the same usergroup. Does such condition exist?

Dave
01-21-2015, 09:21 AM
Is this for the postbit template? I don't think the post user's usergroupid variable is available by default in the postbit template.

Skyrider
01-21-2015, 09:32 AM
Indeed it is for the postbit. Quite a shame if such condition isn't even available. :-\

Dave
01-21-2015, 09:39 AM
Actually it is available, my bad. Just use $post['usergroupid'].

ozzy47
01-21-2015, 09:45 AM
You can use this in the postbit templates.

<vb:if condition="is_member_of($post,6,7)">
Stuff here
</vb:if>

The above will only show if you are a member of 6 or 7

Skyrider
01-21-2015, 09:45 AM
Thank you, seems to work perfectly. I normally would use ranks for this kind of stuff, but seeing the user is moved to another usergroup by force (general update tool / task), the rank is not applied to the user. So I have to do a small by-pass by using a template condition instead..

Thanks again!

The above will only show if you are a member of 6 or 7
That's the small problem ;) I want the text/image to display to every single usergroup if the user is part of a specific usergroup.

<vb:if condition="$post[usergroupid] == xx">xxx</vb:if>
Seems to do just that what I need :D.