2010-09-12, 01:29 AM
Hi,
For the life of me, I can't seem to get the following plugin to work.
Simply, what it does is selects the "bar" (global) template, and evals it inside the footer template as {$bar}. But, for some reason, I can't get it to do that.
For the life of me, I can't seem to get the following plugin to work.
<?php
// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("index_start", "bar_run");
function bar_info()
{
return array(
"name" => "Plugin Name",
"description" => "Plugin Description",
"website" => "",
"author" => "Dutchcoffee",
"authorsite" => "",
"version" => "1.0",
"guid" => "",
"compatibility" => "*"
);
}
/*function bar_activate()
{
}*/
function bar_run()
{
global $mybb, $db, $templates, $bar;
$templatelist = "bar";
eval("\$bar = \"".$templates->get("bar")."\";");
}
?>
Simply, what it does is selects the "bar" (global) template, and evals it inside the footer template as {$bar}. But, for some reason, I can't get it to do that.