2020-06-07, 01:50 PM
I have this plugin where I add support for a page loader for my theme.
However, for some reason, it will not load the theme-specific template called "pageloader", it will only load it if it's inside the Global Templates?
Here is a snippet of my code loading out the template.
Any idea what I am doing wrong?
However, for some reason, it will not load the theme-specific template called "pageloader", it will only load it if it's inside the Global Templates?
Here is a snippet of my code loading out the template.
// Make sure we can't access this file directly from the browser.
if(!defined('IN_MYBB')) {
die('This file cannot be accessed directly.');
}
if(defined('THIS_SCRIPT')) {
global $templatelist;
if(isset($templatelist)) {
$templatelist .= ',';
}
$templatelist .= 'pageloader';
}
$plugins->add_hook('global_start', 'mytheme_load_globals');
function mytheme_load_globals() {
global $templates, $pageloader;
eval("\$pageloader = \"".$templates->get('pageloader')."\";");
}
Any idea what I am doing wrong?