PDA

View Full Version : Template Conditional Help From BitField


paul41598
25 Aug 2006, 03:46
In my bitfield that I have for a usergroup permission setting I have the below:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



In a plugin I have, this is a part of the code Im using to check that usergroup permission. This seems to work fine


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Now I'm trying to use a conditional based off the candeletewho_admired variable. However it doesnt work worth nothing!

Does this look right?


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I've even tried with no luck this:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

SirAdrian
25 Aug 2006, 03:47
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Try that

paul41598
25 Aug 2006, 03:49
OMG it works! What a waste of 2 hours straight figuring it out. Thanks so much SirAdrian! :)

SirAdrian
25 Aug 2006, 03:51
OMG it works! What a waste of 2 hours straight figuring it out. Thanks so much SirAdrian! :)
lol no problem. :)

What I would do (to keep templates clean), is something like this:

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------





Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

paul41598
25 Aug 2006, 03:54
oo nice, ok I'll try that a bit later...

b.t.w, is that how you handle bitfield conditonals? You have to use the

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



part?

SirAdrian
25 Aug 2006, 03:55
Yep...

You are checking if bits in one number are set in another, arrays just make it easier to figure out which one's you are comparing.