PDA

View Full Version : vB4 Template Conditionals


elenh
03-06-2010, 10:02 PM
Hello , im trying to add 2 banners banner1 & banner 2 with this method:
banner 1 showing every where but no in forum id 1 + 2
banner 2 showing only in forum id 1+2 and not in other forums.

i have read in the articels the bellow topic but the code works not.
https://vborg.vbsupport.ru/showthread.php?t=231525

I have added:

<vb:if condition="$forum[forumid] == 1,2">Show this if forum id is x</vb:if>
<vb:if condition="$forum[forumid] != 1,2">Show this if forum id is not x</vb:if>

but is works not.Ihave tryed with one id too but worked not.
Anyone who can help about?
Thanks.

borbole
03-07-2010, 02:19 PM
Try to use this instead:

<vb:if condition="in_array($forum['forumid'], array(1,2))">Banner code here</vb:if>

This will show it only to the forum id''s 1 and 2.



Whereas this below will show it to every forum but 1 and 2.

<vb:if condition="!in_array($forum['forumid'], array(1,2))">Banner code here</vb:if>

elenh
03-07-2010, 04:54 PM
Thanks for the help!

borbole
03-07-2010, 07:15 PM
Thanks for the help!

You are welcome.