MyBB Community Forums

Full Version: Hooks Explained/Example?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've read over some resources and other questions, but since I don't know PHP I can't fully grasp how to hook a variable from one page to another page for MyBB. I face this problem often, so I think it would be beneficial to at least know the concept.

As a current example I've loosely followed this tutorial and made a working registration modal that shows on all pages. Now the problem I'm facing is the problem the tutorial ignored, not having a working captcha. If you use captcha you can't register without completing it and since its variable {$regimage} doesn't work outside of member.php, the tutorial chose to disable captcha all together. I would feel safer having it though. It appears that my answer may be here, but it's a specific question and again I have no idea of how to implement that into my php files.

I haven't found a lot of information on this for beginners, so would someone mind possibly using my example and explaining how hooks are used to make a variable from one page work in another page?
(06-08-2016, 09:15 AM)delay Wrote: [ -> ]This might help you..

Yea I actually read through that, and though it's a great guide I think the way plugins and pages use hooks are different. Correct me if I'm wrong, but I tried a hook from that tutorial and it just broke my page.
Show us code.

Also, a list of hooks are here: