MyBB Community Forums

Full Version: MyBB Eval Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I've created a plugin to insert a template, and eval/ it. Though, I'm having trouble trying to get it to display.

I'm using the following in my plugin:

function bar_functions()
{
	global $mybb, $templates;
	
	$templatelist = "bar";
	
	eval("\$bar = \"".$templates->get("bar")."\";");
}

I'm wanting it to be able to use {$bar} in my index template, but it's not displaying the "bar" template like it should.

Am I missing something?

Edit: Maybe I'm not using a correct plugin hook?

$plugins->add_hook("pre_output_page", "bar_functions");

Thanks.
I'd just use the index_start hook, but you need to globalise $bar in bar_functions()
I did what you said, and it worked perfectly.

Thank you very much! Big Grin
//Close Please

Thanks. Smile