创建插件以在Smarty 3中调用mybb标头模板

I am working with a Smarty 3 script and I need to call mybb header and footer templates. I normally just create a .php page and put the eval code directly in it but I can't do that with smarty I have to make a plugin. Is it possible to make a plugin that calls templates from mybb?

The normal code to call mybb templates would be like..

<?php 

define('IN_MYBB', 1); require "./global.php";

add_breadcrumb("Title here", "somename.php"); 

eval("\$html = \"".$templates->get("template_name")."\";"); 

output_page($html);

?>

I have never worked with Smarty let alone making plugins for this?

If you want to assign anything to variable in PHP using Smarty, you could use fetch() method.

For example in PHP:

$html = $smarty->fetch('template.tpl');

In Smarty template file:

This is template.

And after running it, you will have assigned This is template text to $html variable.