Announcement

Collapse
No announcement yet.

Custom profile fields - checkboxes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom profile fields - checkboxes

    Hi

    I have a problem. I've created a custom profile field with checkboxes and ability to check more than one. Now I'm trying to write a module and get access to this field value. But $userinfo['field21'] contains this - "5647856". How can I translate this to a readable format?

    Thanks a lot

  • #2
    Checkboxes use bit permissions.

    first entry = 1
    second entry = 2
    third entry = 4
    forth entry = 8

    You have to use a bit comparsion and write out manual code.


    <if condition="$post[field21] &= 1"> Checkbox 1 was checked</if>
    <if condition="$post[field21] &= 2"> Checkbox 2 was checked</if>
    <if condition="$post[field21] &= 4"> Checkbox 3 was checked</if>

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X