MyBB Community Forums

Full Version: Make variable from PlugIn available in template?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(2014-06-20, 01:34 AM)Destroy666 Wrote: [ -> ]Yes, please keep it nice, they tried to help.

Also, look again at the lists and you'll notice that there are way too many hooks to describe each. And I have no idea what kind of description are you looking for. Could you provide an example for index_start? In my opinion, file, line, name and basic PHP/MyBB knowledge is all you need.

My question was: Why my variable isn't available when I hook my functions to "newreply_do_newreply_start, newreply_start, newthread_do_newthread_start, newthread_start etc." which are supposed to be called when a new thread/reply is made?

Now you see why some documentation on hooks would be helpful. Just a little "Hey this is post-render not pre-render and the "start" in the name is just for LOLz. So don't even try to make new variables available in the templates.". Thanks to the link you provided now I know that I must hook to "pre_output_page" and check if I'm in one of the pages where the editor is needed.

And simply posting a link that is one of the first thing one would visit when using hooks is not "helpful". Where do you think I got the names for "newreply_do_newreply_start, newreply_start, newthread_do_newthread_start, newthread_start etc."? They just popped out of my brain and worked. I simply took that as an insult.

@jshort Well, my bad Big Grin I should have figured that out in the first place since the username is so obvious. And the "bro" thing is just me being sarcastic. I never use that when addressing to someone.

Anyway, just close the thread because I don't like going off-topic and I'm guessing that my question was answered (partially). Thank you effone for making me aware of the order in which the hooks I used we're executed. And thank you Destroy666 for the helpful link you provided.
Pages: 1 2 3