The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Multi Conditionals In Templates
Just curious im trying to implement images per certain post counts per users via a template. I been doing some reading on conditionals and i somewhat got it down.
However it seems i cannot do it the way i think works so i need some ideas. Code:
<vb:if condition="$userinfo[posts]<24"><img class="inlineimg onlinestatus" src="pranks/star1.gif" border="0" /> <vb:elseif condition="$userinfo[posts]>25 AND $userinfo[posts]<49"><img class="inlineimg onlinestatus" src="pranks/star2.gif" border="0" /> <vb:elseif condition="$userinfo[posts]>50 AND $userinfo[posts]<74"><img class="inlineimg onlinestatus" src="pranks/star3.gif" border="0" /></vb:if> The following error occurred when attempting to evaluate this template: Invalid Tag Nesting This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish. Any ideas would be greatly appreciated! |
#2
|
|||
|
|||
I think the problem might be that the vb:elseif tags aren't closed. You can close them by ending them with '/>'. Also, you don't really need the checks for the lower values, since if that part was true it would have matched the previous condition. So I think something like this should work:
Code:
<vb:if condition="$userinfo[posts]<25"><img class="inlineimg onlinestatus" src="pranks/star1.gif" border="0" /> <vb:elseif condition="$userinfo[posts]<50" /><img class="inlineimg onlinestatus" src="pranks/star2.gif" border="0" /> <vb:elseif condition="$userinfo[posts]<75" /><img class="inlineimg onlinestatus" src="pranks/star3.gif" border="0" /></vb:if> Also if someone has 75 or more posts, they won't get any stars. If 3 is the max, then you would want to use <vb:else /> for the last one, without any 'condition='. (Actually, that would give 3 stars to everyone over 50). |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|