The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi,
I am currently trying to modify some of the features in vB which only takes effect based on the forum ID. I have: # In: phpinclude_start Code:
$article_forums = array(4,5); And in the template(s) I have: Example template, forumdisplay: Code:
<if condition="in_array($forumid,$article_forums)"> stuff <else /> other stuff </if> However this gives me the following error: Quote:
Code:
<if condition="in_array($forumid,array(4,5))"> stuff <else /> other stuff </if> Any help is appreciated. |
#2
|
||||
|
||||
![]()
Just a guess here - but does the variable need to be declared as global ?
|
#3
|
|||
|
|||
![]()
There is an error in the title, it is not a variable but an array, and as far as I know I don't think global needs to be defined as I am using other if statements with it and working fine.
For example: <if condition="$article_forums[0]=4"> stuff <else /> other stuff </if> Works fine |
#4
|
|||
|
|||
![]()
Try moving the
PHP Code:
I think it would work then. |
#5
|
|||
|
|||
![]()
Thanks I figured it out:
Have the forum ID's in a variable in phpinclude_start: Code:
$test = "1,2,3,4,5,6"; Code:
<if condition="in_array($forumid, array($test))"> stuff <else /> other stuff </if> Is there a reason for this, I thought that phpinclude_start was global? |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|