MyBB Community Forums

Full Version: str_rplace in Admin CP via hook...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Seems like a very simple task, but I'm having trouble. I'm trying to insert a variable that carries text into the Admin CP. My hook is:

$plugins->add_hook('admin_page_output_header', 'plugin_acp_msg');

function plugin_acp_msg($page)
{
	$page = str_replace("<div id=\"content\">", "<div id=\"content\"><p>Message</p>", $page);
	return $page;
}

I want to replace the <div id="content"> as you can see in the header of the Admin CP. What am I doing wrong? Do I have to give permission to modify the Admin CP? If so how?

Solved my own problem. You can't change any admin files as they don't have any template files. What I used instead was the flash_message function.