MrEyes
09-09-2010, 08:16 PM
I have a mini mod on my site that looks something like this:
Hook Location : global_start
Execution Order : 5
PHP Code : require_once('./includes/_taglinemessages.php');
The code for the included PHP file looks something like this:
<?
$taglines = array();
$taglines[] = 'Text 1';
$taglines[] = 'Text 2';
$taglines[] = 'Text 3';
$rand_keys = array_rand($taglines, 1);
$template_hook['tagline'] = $taglines[$rand_keys];
?>
Then in my header template I have the following:
<span>Message : <i>{vb:raw template_hook.tagline}</i></span>
Now, all this works perfectly and on each refresh I see a random selection from the $taglines array displayed at the top of the page. However it doesn't work on any CMS page. So either I am using the wrong hook of the template_hook variable isn't part of the cms templater code.
So, does anybody have any ideas on how to solve this?
Hook Location : global_start
Execution Order : 5
PHP Code : require_once('./includes/_taglinemessages.php');
The code for the included PHP file looks something like this:
<?
$taglines = array();
$taglines[] = 'Text 1';
$taglines[] = 'Text 2';
$taglines[] = 'Text 3';
$rand_keys = array_rand($taglines, 1);
$template_hook['tagline'] = $taglines[$rand_keys];
?>
Then in my header template I have the following:
<span>Message : <i>{vb:raw template_hook.tagline}</i></span>
Now, all this works perfectly and on each refresh I see a random selection from the $taglines array displayed at the top of the page. However it doesn't work on any CMS page. So either I am using the wrong hook of the template_hook variable isn't part of the cms templater code.
So, does anybody have any ideas on how to solve this?