MyBB Community Forums

Full Version: Output debug info?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I output some debug information from my plugin?

I tried looking at another plugin to figure it out. It used flash_message(). So I tried the following when my plugin activates:

flash_message("ERROR!@!!", 'error');

And nothing happened!
Can you post your code? Where did you put the flash_message() call exactly? I think there's another redirect after activating a plugin so the flash message would get lost.
Are you outputting the page?
(2012-09-02, 11:26 AM)MattRogowski Wrote: [ -> ]Can you post your code? Where did you put the flash_message() call exactly? I think there's another redirect after activating a plugin so the flash message would get lost.

For my plugin, I have the following:

function myplugin_activate()
{
	flash_message("ERROR!@!!", 'error');
}

What I want is that when my plugin gets activated, it will show, "ERROR!@!!" or whatever info I want. If there is a redirect, how would I get it to show? The akismet plugin hooks into "admin_config_plugins_activate_commit" and runs the "akismet_key" which calls flash_message(). So does that mean that I have to do the same just to get flash_message() to show up?

(2012-09-04, 12:55 AM)Dannymh Wrote: [ -> ]Are you outputting the page?
No, just that message.
What about using exit; or die(); just after flash_message() is executed?