MyBB Community Forums

Full Version: Nav Template Hook ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Im looking to eval a template via a variable in the Navigation >> Nav template. But im unable to find the appropriate hook. Any ideas ?
global_start
Tried it already, doesn't work. I tried the most obvious ones, none seem to work. Im stumped Confused
Make sure you're adding $templates, $template_variable as global object.
Yes I have all that added.
Alright, can you please paste your code here ?
I dont have much code at the moment, I just have an eval inside a function.
eval("\$test = \"".$templates->get("test_template")."\";");


My global objects are:
global $db,$mybb,$templates,$test;

And finally I'm using find and replace to insert the variable. Inserting the variable works just fine. Just outputting the template is the problem.
Its hard to find where's the culprit without viewing the code actually. If its private then feel free to PM so I could check myself.
Thats literally the code, an info and activate function (as standard), the find and replace to insert the variable in the nav template and one function:


$plugins->add_hook('global_start', 'test_run');
function test_run()
{
	global $db,$mybb,$templates,$test;
        
        eval("\$test = \"".$templates->get("test_template")."\";");
	
}
And you have {$test} in your template then?
Pages: 1 2 3