MyBB Community Forums

Full Version: Why plugin don't show the text?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
<?php
if(!defined("IN_MYBB")) die("Zabladziles? ;)");

function character_panel_info() {
	return array(
		"name"			=> "Character Panel v1.0",
		"description"	=> "Character Panel for Redneck Jump RolePlay",
		"website"		=> "",
		"author"		=> "Ethernet",
		"authorsite"	=> "",
		"version"		=> "1.0",
		"guid" 			=> "",
		"compatibility" => "1*"
	);
};

if(defined('THIS_SCRIPT'))
{
    global $templatelist;

    if(isset($templatelist))
    {
        $templatelist .= ',';
    }
	
	$templatelist .= 'characters_index';
}

$plugins->add_hook('global_start', 'character_panel_peis');

function character_panel_peis() 
{
	$message = 'test';
	
	global $lang, $templates;

    $steamID_profile = eval($templates->render('characters_index'));
	
	echo 'done';

};	

?>

Here's my code, I added template characters_index. Why not showing the text from template? I wrote "Hello World" in template, but is don't exist on any page. Any suggestions?
Use

eval('$page = "' . $templates->get('characters_index') . '";');
output_page($page);
I don't think templates get cached before *global_start* so you should probably stick to *global_intermediate*.