2022-07-08, 08:30 PM
Working on my next plugin to release.
While building and testing I'm finding that my function to load a template on the index is not working and I do not understand why.
PHP in plugin:
The {$affiliates} variable is placed inside the index template. The affiliates_index template itself has "testing testing" in it just so I can see it work but it doesn't show. Am I using hooks wrong here? I'm just trying to get a template to pop up on the index.
While building and testing I'm finding that my function to load a template on the index is not working and I do not understand why.
PHP in plugin:
$plugins->add_hook('index_start', 'affiliates_index');
function affiliates_index() {
global $mybb, $db, $theme, $templates;
if ($mybb->settings['affils_active'] == 1) {
eval("\$affiliates = \"".$templates->get("affiliates_index")."\";");
}
}
The {$affiliates} variable is placed inside the index template. The affiliates_index template itself has "testing testing" in it just so I can see it work but it doesn't show. Am I using hooks wrong here? I'm just trying to get a template to pop up on the index.