The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Use array from plugin in template as conditional
Hey Guys,
I have read a lot about using variables from plugins inside the FORUMDISPLAY template. But nothing really covers what I'm trying to do. What I'm trying to do is create a conditional based on specific parent forumids - but using an array. I can access the parentlist id's on a page using Code:
{vb:raw $foruminfo[parentlist]} Once I have that, I want to basically say, if 'parentlist' CONTAINS '610' then show this. I know you can't do a CONTAINS conditional that way because vbulletin doesn't allow it, and the parenlist is just a string, not an array. So I need to make a plugin to turn the parentlist into and array. Then register it for use in the FORUMDISPLAY template. For that I used PHP Code:
Now I want to say in my FORUMDISPLAY template. If $parentarray CONTAINS '610' then show this. For which is used: Code:
<vb:if condition="in_array(610, parentarray)"><!-- It's working --></vb:if> I believe everything is working up to the conditional statement, and I'm not sure if I'm accessing the parentarray variable in the right way. Any help would be appreciated. Thanks, hilaryl |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|