MyBB Community Forums

Full Version: support for third party SEO
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2009-01-11, 05:41 PM)Ryan Gordon Wrote: [ -> ]But then you'd break all the other plugins trying to use that hook.

That was of course assuming there is a counterpart to $plugins->add_hook that just removes my own personal hook, not the hooks of other plugins. I haven't checked if there is a delete/remove_hook actually. Would be more efficient than calling my hook function 50 times when it's no longer required.

Quote:And 50 queries? Really? Something like that would increase the load on a large forum 2-5 times. It's not that the queries aren't fast, it's that every time you query a MyISAM table you lock it from other queries until it finishes that query.

Yes, but it doesn't matter at all on the average forum that sees less than 1 hit per second (with queries that are so simple that they finish almost instantly). I know that big forums are a different story. I don't see a big forum install my SEO plugin though or if they do, they'd have a server that can take it.

Just tested it, running $plugins->remove_hook("hook", "my_plugin_function") inside my_plugin_function seems to work fine. Other functions added for the same hook still get called, whereas mine gets called only once (the first time). And I can access $threadcache this way. Probably not meant to be used that way but as long as it works and saves a ton of queries, why not.

Thanks again for your input, it's very valuable. Smile
Pages: 1 2