The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
vb:if condition with multiple forum ID's??
Hi everyone,
My developer retired and I've been doing site upkeep myself. After adding subforums to a forum area though, the original conditionals are not displaying one particular ad spot correctly. Any help straightening this out would be appreciated. this is what is currently in the template for the ad display; <vb:if condition="$vbulletin->GPC['forumid'] == 48"><vb:if condition="in_array($vbulletin->GPC['forumid'], array(48,66,67,-1))"><table width="100%" style="background-color:#ffffff;"> I tried (unsuccessfully) to add three other forum ID's to the "==48" but that didn't work and in the process I think maybe the software tried to accommodate my error by adding the next vb:if condition with the array reference (is that even possible for it to generate code in trying to repair a coding error?) So what use to be a conditional testing to see if the forum being displayed was 48 in order to place the correct ad, it now needs to test for four different forum ID #'s. Can someone please explain the correct way to make it test for four different ID's before choosing which ad to run? Thanks very much. Bart |
#2
|
|||
|
|||
I don't know of any way the software could generate that code for you. It's more likely that at some point someone added the first condition and forgot to delete the second one, or just left it there (since in this case the second one doesn't do anything when it's inside the first one).
In any case I think you want something like this: Code:
<vb:if condition="in_array($vbulletin->GPC['forumid'], array(48,66,67,-1))"><table width="100%" style="background-color:#ffffff;"> and make sure 48,66,67,-1 is what you want (I don't know what -1 does). Also, you will have to remove the corresponding </vb:if> (which isn't in the code you posted). |
#3
|
|||
|
|||
thanks for the reply kh99....i've been playing with the code all day and finally got something that i can live with. it's not exactly what i was shooting for but i actually like it more than what i originally had in mind and it was by luck that it's worked out the way that it did!
the site is www.multirotorforums.com and it is the DJI Sub-Forum that I was trying to fix. I wanted to have a DJI full-width banner replace the Droidworx banner in all of the DJI sub-forum areas but I can't figure out all of the conditional statements and how they're nested to make it work. by using the array statement in one of them I've got the DJI banner in all of the subforums along with the droidworx banner which is something i didn't know was possible. so it worked out in the end even if it's different from what i was trying to do. thanks again, bart |
#4
|
||||
|
||||
Quote:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|