Quote:
Quote:
In general to do this for arrays it would be: Code:
<if condition="in_array($forum[forumid], array(2, 3, 4, 5, 6 ))"> Code:
<if condition="!in_array($forum[forumid], array(2, 3, 4, 5, 6 ))"> |
I'm trying to find the conditional to include "in every forum except (several forums). I wasn't sure what the "!=" meant but I thought that might be it so I tried this but it was a no-go.
Code:
<vb:if condition="!in_array($foruminfo[forumid], array(26, 46 )">MyScript</vb:if> I'm using vB4.... |
Quote:
(Also, this is a vB3 article, although most of the conditions are valid, but in vB4 it does matter what template you use a variable in.) |
I was using it in the same FORUM DISPLAY template that we changed that variable to fix. Sorry I posted in the vB3 article. I didn't realize it till after I had done it but then figured it was still my best chance because the post just before seemed to relate.
I tried posting in my other thread but it did that auto-merge again : ( (but I see you found it anyways...LOL.) |
The VB4 version of this thread is here. I don't want to talk about VB4 in a VB3 thread. If you're still having issues please post in the VB4 thread for help.
|
Yes, I apologize. I didn't realize it when I first typed my post... Then I left it.
Moving on... |
I want to exclude the forums listed below. But when I use this conditional, I get an error. What am I doing wrong? I'm running 3.8.6 PL1
Code:
<if condition="$forum[forumid] != 1,2,3,4">google ad code here</if> I get the error: Code:
The following error occurred when attempting to evaluate this template: I'd also like to exclude certain usergroups from seeing ads. How do I accomplish both of these things? |
What's wrong is your condition is wrong... it should look like this:
Code:
<if condition="!in_array($forum['forumid'], array(1,2,3,4))"></if> |
Thanks! Is there a way to use two conditionals? I don't want ads showing up in certain forums, and there's on particular usergroup that I want to block ads from. Is this possible?
|
Code:
<if condition="!in_array($forum['forumid'], array(1,2,3,4)) AND !is_member_of($vbulletin->userinfo, 5,6)"> |
All times are GMT. The time now is 07:36 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|