MyBB Community Forums

Full Version: How can I print/see debug messages?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For development purposes, to test things, I would really love to debug my code.

Naive me I was thinking I could just put a "echo" or "print_r" in my PHP code. But I don't see any text anywhere.

All I could find on here and the internet is people having this issue and a plugin solving this for 1.6.


So, how do I print messages and variables somewhere to debug in 1.8?


Thank for helping Smile
You should be able to just use echo or var_dump or any other standard PHP function. Which hook are you using and can you post your code?
Thanks for the fast reply.

Actually I am trying to do some edits to the "forumdisplay.php".
See this thread http://community.mybb.com/thread-158668.html, this section just seemed more appropriate for the question.

For now I just wanted to get a "echo('this is testing echo');" working at the top of the file. After that I want to dump query results. Where the "forumdisplay_get_threads" hook is run.
The echo should definitely display. It should be visible at the top of the page.
(2014-11-13, 10:33 PM)Euan T Wrote: [ -> ]The echo should definitely display. It should be visible at the top of the page.

Okay, so maybe I am trying to mess with the wrong file.

I was editing "mybb/forumdisplay.php". Just tried deleting this file and the forum still worked fine.

Which file should I be editing?


Thanks for helping a newbie Smile



I realized my mistake....

Working on displaying forums on the index and not on forumdisplay.
Forumdisplay is this page: http://community.mybb.com/forum-68.html