2011-05-15, 07:43 PM
Hey,
I'm trying to create a very simple plugin without any knowledge of php.
I've taken the hello world plugin and made a few adjustments.
Original:
New:
Original:
New:
It hasn't worked.
What's going wrong?
Cheers,
Clarkie
I'm trying to create a very simple plugin without any knowledge of php.
I've taken the hello world plugin and made a few adjustments.
Original:
$plugins->add_hook("pre_output_page", "hello_world");
$plugins->add_hook("postbit", "hello_world_postbit");
New:
$plugins->add_hook("postbit_author_user", "hello_world_postbit");
Original:
function hello_world($page)
{
$page = str_replace("<div id=\"content\">", "<div id=\"content\"><p>Hello World!<br />This is a sample MyBB Plugin (which can be disabled!) that displays this message on all pages.</p>", $page);
return $page;
}
function hello_world_postbit($post)
{
$post['message'] = "<strong>Hello world!</strong><br /><br />{$post['message']}";
}
New:
function hello_world_postbit($post)
{
$post['warninglevel'] = "{$post['warninglevel']}<br /><strong>Hello world!</strong>";
}
It hasn't worked.
What's going wrong?
Cheers,
Clarkie