Support Forums

Full Version: Array Condition on MyBB Forums (PHP Enabled)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I want to add a condition to a content in the header of MyBB.

I have enabled the PHP and templates conditionals and I need to add the code manyally, here is the code:

PHP Code:
<if condition="!in_array($GLOBALS[forumid],array(2))">
Here is the content.
</if> 

What I want to do is enable the code with the exception of the array code in this case 2.

Thanks.
I did not used that too much, so I'm not sure about the solution...

I googled a bit, and I think this will help you...
http://community.mybboard.net/thread-31860.html
Thanks, Im using these plugin, but I need to use the code that I posted to make an excemption on some forums.

Thanks.
Well as far as I understand the plugin, you would do something like this...
But note that I can't test it and I'm not sure...
You will get better answers from the creator of the plugin....

PHP Code:
# you would first need to declare a variable
$condition in_array($GLOBALS[forumid],array(2));
<if 
$condition then>
2
<else />0
</if> 
Mmm, I have tested without luck.

BTW, Thanks for response Smile