Log in

View Full Version : Conditional question


cinq
02-17-2005, 01:34 PM
There's something wrong here.
How should I correct it ? :)


<if condition="$bbuserinfo[usergroupid]==6 || ($permissions['linkspermissions'] & CANEDIT) || ($permissions['linkspermissions'] & CANDEL)">


I think it's got to do with the parethsis ?

Marco van Herwaarden
02-17-2005, 04:06 PM
i don't think you can use a bitwise AND (&) in a template.

cinq
02-18-2005, 05:47 AM
Actually I think I got it solved, probably a missing closing </if> tag somewhere :D

Marco, I think it can be done :)

neocorteqz
02-18-2005, 06:06 AM
well not to hijack the thread, but i have a question about array's,

now this is the normal if conditional I use in templates to select multiple usergroups.

<if conditional="$bbuserinfo[usergroupid] == X OR $bbuserinfo[usergroupid] == Y">
Some code here
</if>


How would I make than an array instead so i can shorten the code and clean it up a bit, instead of having to type the long way? :)


Thanks.

Also i though PHP was only allowed to be used in the phpinclude_ templates. Is this not true?

cinq
02-18-2005, 06:08 AM
is_member_of , or in_array, perhaps ? :)

neocorteqz
02-18-2005, 06:11 AM
is_member_of , or in_array, perhaps ? :)

<if condition="is_member_of($usergroupid,X,Y,Z)">


that right? Still a novice coder. :)


Edit, no spaces or it complains, but that works. :)

cinq
02-18-2005, 06:14 AM
Thanks.

Also i though PHP was only allowed to be used in the phpinclude_ templates. Is this not true?

http://www.vbulletin.com/docs/html/main/functions_in_conditionals
:)



<if conditional="$bbuserinfo[usergroupid] == X OR $bbuserinfo[usergroupid] == Y">
Some code here
</if>



Btw the way I think it should be condition and not conditional :)

Or just refer here (https://vborg.vbsupport.ru/showthread.php?t=72556)

neocorteqz
02-18-2005, 06:20 AM
http://www.vbulletin.com/docs/html/main/functions_in_conditionals
:)



Btw the way I think it should be condition and not conditional :)

Or just refer here (https://vborg.vbsupport.ru/showthread.php?t=72556)

i just noticed that.. that was a typo.

thanks.