The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
I have a dropdown call template and below is the code in the template:
Code:
<!-- post specs_menu --> <if condition="$post['field23']"> <div style="background-image: url('http://glitchpc.com/forums/images/buttons/specs.gif'); position:absolute; width:auto;" id="specs_$post[postid]" class="vbmenu_control"> <a href="#specs">$vbphrase[dropdown_title]</a> <script type="text/javascript"> vbmenu_register("specs_$post[postid]"); </script> </div> </if> <!-- / post specs_menu --> I want to exclude certain forums from using this code (or calling the template)...so I tried the following and I get a parse error...malformed conditional. Code:
<!-- post specs_menu --> <if condition="$forum[forumid] != XX"> <if condition="$post['field23']"> <div style="background-image: url('http://glitchpc.com/forums/images/buttons/specs.gif'); position:absolute; width:auto;" id="specs_$post[postid]" class="vbmenu_control"> <a href="#specs">$vbphrase[dropdown_title]</a> <script type="text/javascript"> vbmenu_register("specs_$post[postid]"); </script> </div> </if> </if> <!-- / post specs_menu --> The code above will work with one forum...where the forum ID is "XX". However, if I add another forum ID after the XX (separated by a comma) the conditional fails...malformed syntax. Can someone help me correct this? Thank you. |
#2
|
|||
|
|||
![]()
If I understand you correctly, you shoul write something like that.
Code:
<if condition="$forum[forumid] != XX || $forum[forumid] != YY"> |
#3
|
||||
|
||||
![]()
Choo...thanks for the reply...
Nope...that didn't work, either... |
#4
|
|||
|
|||
![]()
But it should work
![]() Code:
$ids = array(123, 234, 345); //forums ids <if condition="!in_array($forum[forumid], $ids)"> |
#5
|
|||
|
|||
![]()
Choo, you have the right idea, but the $ids must be in a php script, or if you have a setting group in vBulletin Options, you could do $vboptions['setting_name'] for the $ids replacement.
|
#6
|
||||
|
||||
![]()
This should work for an array of forumids:
HTML Code:
<if condition="in_array($forum['forumid'], array(xx,yy,zz))"> whatever </if> |
#7
|
||||
|
||||
![]()
Okay...here's what I'm using...and I'm getting a parse error...
Code:
<!-- post specs_menu --> $ids = array(8, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66); //forums ids <if condition="!in_array($forum[forumid], $ids)"> <if condition="$post['field23']"> <div style="background-image: url('http://glitchpc.com/forums/images/buttons/specs.gif'); position:absolute; width:auto;" id="specs_$post[postid]" class="vbmenu_control"> <a href="#specs">$vbphrase[dropdown_title]</a> <script type="text/javascript"> vbmenu_register("specs_$post[postid]"); </script> </div> </if> </if> <!-- / post specs_menu --> Hi, Lynne... --------------- Added [DATE]1244477096[/DATE] at [TIME]1244477096[/TIME] --------------- Tried this, as well...still no workie...heh: Code:
<!-- post specs_menu --> <if condition="in_array($forum['forumid'], array(8,56,58,59,60,61,62,63,64,65,66))"> <if condition="$post['field23']"> <div style="background-image: url('http://glitchpc.com/forums/images/buttons/specs.gif'); position:absolute; width:auto;" id="specs_$post[postid]" class="vbmenu_control"> <a href="#specs">$vbphrase[dropdown_title]</a> <script type="text/javascript"> vbmenu_register("specs_$post[postid]"); </script> </div> </if> </if> <!-- / post specs_menu --> |
#8
|
||||
|
||||
![]()
Try combining the two ifs, like suggest above. It also helps to know the exact error you are getting or if it's not working, exactly what you see is not working.
|
#9
|
||||
|
||||
![]()
Don't take it for granted that because I have the word "Coder" under my username that I have a clue as to what you mean by combining the IF statements...sorry.
In this particular case...I get a parse error...I don't have the exact code...but it does refer to it being a conditional error. So...I'm assuming it has something to do with the way it's coded. |
#10
|
||||
|
||||
![]()
To combine two conditions, you just add an AND (or sometimes an OR, it depends on what you want) between the two. Remove the extra </if> after you combine them.
HTML Code:
<if condition="in_array($forum['forumid'], array(8,56,58,59,60,61,62,63,64,65,66)) AND $post['field23']">
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|