Support Forums
Array Condition on MyBB Forums (PHP Enabled) - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21)
+---- Thread: Array Condition on MyBB Forums (PHP Enabled) (/showthread.php?tid=4685)



Array Condition on MyBB Forums (PHP Enabled) - Rafael - 02-05-2010

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.


RE: Array Condition on MyBB Forums (PHP Enabled) - Gaijin - 02-05-2010

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


RE: Array Condition on MyBB Forums (PHP Enabled) - Rafael - 02-05-2010

Thanks, Im using these plugin, but I need to use the code that I posted to make an excemption on some forums.

Thanks.


RE: Array Condition on MyBB Forums (PHP Enabled) - Gaijin - 02-05-2010

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> 



RE: Array Condition on MyBB Forums (PHP Enabled) - Rafael - 02-09-2010

Mmm, I have tested without luck.

BTW, Thanks for response Smile