View Full Version : Help figuring out is_member_of
sully02
06-04-2005, 10:13 PM
I have a snippet of code in a file that displays a message for those not in paid membership groups. The problem is, despite my attempts to code it so the paid members can't see it, they still see the message. Here's the conditional I'm currently using:
if (!is_member_of($bbuserinfo, 18) OR !is_member_of($bbuserinfo, 19) OR !is_member_of($bbuserinfo, 20))
{
//Code I don't want paying members to see
}
However, it's not working. Can anyone help me figure out what I'm doing wrong?
Andreas
06-04-2005, 11:52 PM
So you don't want to have the code displayed to members that are not in usergroup ID 18, 19 or 20?
Then use this code
if (!is_member_of($bbuserinfo, 18) AND !is_member_of($bbuserinfo, 19) AND !is_member_of($bbuserinfo, 20))
{
//Code I don't want paying members to see
}
Boolean Algebra:
NOT (x OR y OR z) = (NOT x) AND (NOT y) AND (NOT z) => DeMorgan's Theorems
sully02
06-05-2005, 02:47 AM
So you don't want to have the code displayed to members that are not in usergroup ID 18, 19 or 20?
Then use this code
if (!is_member_of($bbuserinfo, 18) AND !is_member_of($bbuserinfo, 19) AND !is_member_of($bbuserinfo, 20))
{
//Code I don't want paying members to see
}
Boolean Algebra:
NOT (x OR y OR z) = (NOT x) AND (NOT y) AND (NOT z) => DeMorgan's Theorems
Wow, I wasn't aware of that one. Then again, I haven't taken any logic classes yet. I figured using AND for all 3 would do a check to see if a user was in all 3 usergroups.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.