This is good stuff. I do have a question that isn't covered.
Say I have a multiple choice custom user profile field that is stored bitwise in the database.
Example:
Choice 1 = 1
Choice 2 = 2
Choice 3 = 4
Choice 4 = 8
Choice 5 = 16
So if a user selected choices 4 and 5, the stored value would be 24.
How could I evaluate this easily with an If/Then statement so that I could display the appropriate icons under the username in the postbit based upon each choice.
For example, the for the user above it would need to display two icons that correspond to choices 4 and 5.
If an user had selected ALL fields, the value would be 31, and it would need to display 5 icons.
I've done plenty of the <if condition="is_member_of($post, X)"> logic when it comes to usergroup membership, but this bitwise storage is confusing.
Can anyone show me a quick sample that would help clear this up for me?
Edit: I figured it out. Here's the answer for anyone looking for it:
Code:
<if condition="$post[field11] & 2">
<div><img src="images/badge2.gif"></div>
</if>
<if condition="$post[field11] & 4">
<div><img src="images/badge3.gif"></div>
</if>