The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
Okay, you were right about the numbers. Some were wrong. I updated the numbers though and it still didn't do anything. I tried using == like you said and that didn't work. Did I do it like you were thinking... ?
Code:
<vb:if condition="$userfield['field23'] == 1"> Unknown <vb:elseif condition="$userfield['field23'] == 2" /> No Food <vb:elseif condition="$userfield['field23'] == 4" /> Breakfast <vb:elseif condition="$userfield['field23'] == 8" /> Lunch <vb:elseif condition="$userfield['field23'] == 16" /> Dinner <vb:elseif condition="$userfield['field23'] == 32" /> Snacks </vb:if> |
#12
|
|||
|
|||
OK, I went back and read the above posts again, and since it's multiple selection, I think you do want to use '&'. And are you sure $userfield is what you want to check? You might want $bbuserinfo[field23] (assuming this is displaying the data to the user who selected it, and not to another user (like an admin or someone).
Also, like you mentioned in an earlier post, since it's possible to have multiple options selected you don't want to use elseif, you would just want a bunch of if statements, like: Code:
<vb:if condition="$bbuserinfo['field23'] & 1">Unknown </vb:if> <vb:if condition="$bbuserinfo['field23'] & 2">No Food </vb:if> <vb:if condition="$bbuserinfo['field23'] & 4">Breakfast </vb:if> |
#13
|
||||
|
||||
This output will be shown to any usergroup type viewing it on a public profile and also in the custom member list I created. It is not meant to show the viewer their own personal selections, but to show the viewer the selection of whoever's profile they are viewing.
|
#14
|
|||
|
|||
In that case you don't want to use $bbuserinfo, of course.
|
#15
|
||||
|
||||
So this does not work either. Any ideas?
Code:
<vb:if condition="$userfield['field23'] & 1"> Unknown <vb:elseif condition="$userfield['field23'] & 2" /> No Food <vb:elseif condition="$userfield['field23'] & 4" /> Breakfast <vb:elseif condition="$userfield['field23'] & 8" /> Lunch <vb:elseif condition="$userfield['field23'] & 16" /> Dinner <vb:elseif condition="$userfield['field23'] & 32" /> Snacks </vb:if> |
#16
|
|||
|
|||
Should have asked this from the start, but which template are you putting that in?
|
#17
|
||||
|
||||
It is going in the template memberinfo_block_aboutme
|
#18
|
|||
|
|||
Then I think you want this:
Code:
<vb:if condition="$userinfo['field23'] & 1">Unknown </vb:if> <vb:if condition="$userinfo['field23'] & 2">No Food </vb:if> <vb:if condition="$userinfo['field23'] & 4">Breakfast </vb:if> etc |
#19
|
||||
|
||||
When I try to save the template with that, I get an error that says "adding child to non-existent node!".
Code:
<vb:if condition="$userinfo['field23'] & 1"> Unknown</vb:if> <vb:if condition="$userinfo['field23'] & 2" /> No Food</vb:if> <vb:if condition="$userinfo['field23'] & 4" /> Breakfast</vb:if> <vb:if condition="$userinfo['field23'] & 8" /> Lunch</vb:if> <vb:if condition="$userinfo['field23'] & 16" /> Dinner</vb:if> <vb:if condition="$userinfo['field23'] & 32" /> Snacks</vb:if> |
#20
|
|||
|
|||
I think you need to take the '/'s out of the <vb:if... tags, like this:
Code:
<vb:if condition="$userinfo['field23'] & 1"> Unknown</vb:if> <vb:if condition="$userinfo['field23'] & 2" > No Food</vb:if> <vb:if condition="$userinfo['field23'] & 4" > Breakfast</vb:if> <vb:if condition="$userinfo['field23'] & 8" > Lunch</vb:if> <vb:if condition="$userinfo['field23'] & 16" > Dinner</vb:if> <vb:if condition="$userinfo['field23'] & 32" > Snacks</vb:if> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|