The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Convert template conditional into plugin code
Hi
I have the following template conditional, variants upon which I use quite a lot: Code:
<if condition="!in_array($foruminfo['forumid'], array(1,2,3,4))"> How would I format the above conditional to make it apply to a block of plugin code? (Assuming it's at a hook where $foruminfo is available). |
#2
|
||||
|
||||
Actually, that one if pretty much the same in php:
Code:
if (!in_array($foruminfo['forumid'], array(1,2,3,4))) |
#3
|
|||
|
|||
Thanks Lynne....I needed that as previously I was using something like
Code:
if ($forum['forumid'] != 1 AND $forum['forumid'] != 2 AND $forum['forumid'] != 3 AND $forum['forumid'] != 4) It was working but I felt it was ridiculously long winded, and I had read somewhere it used marginally more resources doing it that way. |
#4
|
||||
|
||||
The difference would be negligible, unless you're processing a lot of comparisons.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|