I want to create a variable and use it in template conditionals in a few places. So far I'm not getting the scope right, or I haven't figured out the right way to access it within the templates...
I've created a plugin with just this code in it:
Code:
include('./plugins/my_mod.php');
The code in my_mod.php looks something like this:
Code:
<?php
foreach ($vbulletin->forumcache as $forumdata)
{
if ( strpos($forumdata["description"], '<!-- something -->') !== false )
{
$something[] = $forumdata["forumid"];
}
}
?>
This should create an array with elements that are the forumid's for those forums that I've hidden a particular string in the forum descriptions.
The plugin needs to affect the forumhome_forumbit_level1_nopost template as well as the display of navbits in forumdisplay and showthread, at least.
Which hook should I use to make sure the variable $something will be valid when and accessible where I need it?
How do I reference the variable from a template? I've written and tested template conditionals using vbulletin class variables, so I've got the basic syntax working okay. How do I make a variable I create have the same sort of scope?
Finally, as an aside, is hiding stuff in the forum description a really stupid way to customize something to begin with?
Thanks! All help will be much appreciated.
Mike D.