PDA

View Full Version : If then conditional based on user groupid


KenDude
06-16-2011, 05:32 PM
I am working on a template where some specific items in that template I only want to show up if a user is a member of one or more specific user groups. The logic is as follows:

If user is a member of Group A or Group B or Group C then
Display Information X
Else
Display Information Y

It should not matter if Group A, B or C is their primary or secondary group. So for example Group A might be Administrators, Group B Moderators and Group C a custom Group called "People from Mars". The if statement should look to see if the user is any of the 3 user groups and if they are in at least 1 then display the information.

Hopefully my logic makes sense, but I can't seem to get it to work right in a template. Can anyone help?

Thanks!

kh99
06-16-2011, 07:31 PM
I think you just need <if condition="is_member_of($bbuserinfo, A, B, C)">