Jump to content






- - - - -

IP.Board 3.2.0 Dev Update: Hooks Improvements

Posted by teraßyte, in 3.2.x 09 March 2011 · 3,427 views

hooks 3.2 development development update
Parts of this entry may only apply to those who create hooks for IP.Board. Feel free to skip the sections that may not interest you.

As mentioned in our previous blog entries about IP.Board 3.2 we are focusing not only on adding new features but also on improving some of the current areas as well. In this entry I'll talk about the changes we made for hooks.


Global Caches

Several times it might happen that a hook requires a specific cache on every page (like our IP.Chat hook "Chat Tab Count") but there was no way to do that apart from running a separate query on each page load. In IP.Board 3.2 we have added support in the hooks for a system called "Global Caches" which allows modders to specify a set of caches that the board will always load together with the default ones. Such caches can be selected in a new tab we have added in the hooks form and will help reduce the number of queries run.

Attached Image


Hook Requirements

Already in IP.Board 3.0 hooks had 4 requirements fields and nothing changed in 3.1: min/max PHP version and min/max IP.Board version. What if the hook was for a third party addon or even one of our official addons? Was that enough? We felt that the answer was no and thus we have implemented an enhanced applications requirements system.

With the new system you can now specify any installed application as a requirement while creating a hook as well as the usual PHP version. Furthermore, you can specify a minimum and/or maximum version or leave both fields set to 0 to only require the application to be installed.


In the example below the hook will require a PHP version between 5.3.0-5.3.5, a minimum IP.Board version of 3.1.1 and IP.Gallery installed.

Attached Image

When installing a hook that doesn't meet the requirements, a warning badge will appear before the title and a count of all the warnings for enabled hooks will be shown as well above the list.

Attached Image

Clicking on the warning badge will redirect you to the hook requirements page where each requirement has its own badge (ok / error) and as you can see the minimum PHP version requirement is not met.

Attached Image

You will also see the same requirements page when trying to enable a hook already installed that doesn't meet the requirements.  In this case however you'll have the option to skip the requirements check and still enable the hook regardless.

Attached Image


Updates Checker

The update checker for the hooks has been enhanced and now the code can retrieve an 'update url' as well if there is an update available, previously the system simply used the hook website value if one was provided but what if the site got moved or if the modder wants the admins to go to a specific url to get directly the update rather than viewing the main page of their site?

In the old IP.Board 3.0 & 3.1 versions the update script simply returned a 0 value if there was no update or 1 for an update available, now if an update is available IP.Board will explode the string on the character | and take the second value in the array as the url. An example is available below:
1|http://www.google.it/

Attached Image

Additionally IP.Board 3.2 will now add also the IP.Board long version in the update URL together with the hook long version, in this way the update script can return only 1 for older versions or add also the new 'update url' variable for IP.Board 3.2+:
IP.Board 3.1: http://www.domain.com/checkHookUpdate.php?hookKey=test_hook&version=10000
IP.Board 3.2: http://www.domain.com/checkHookUpdate.php?hookKey=test_hook&boardVersion=32000&version=10000


Install a New Hook

As you may have already noticed from the screenshot above the "Install a New Hook" form is now a tab and you won't need to scroll down to the bottom of the page anymore, especially when you have a large list of hooks installed.

Attached Image


Conclusion

Many other small tweaks and optimizations have been implemented in the layout as you can see from the screenshots and also in the code, finally all the enhancements discussed above are available in the Hook Details page as well which contains a summary of everything concerning the hook.

Attached Image



Feel free to comment on this blog entry below or, if you have feedback unrelated to this blog entry, start a new topic in our feedback forum. Be sure to check the What's New in IP.Board 3.2 topic for a running list of announced changes!




YAY
looks great.
Are there more hook improvements yet to come? Any word on my requests?

Are there more hook improvements yet to come? Any word on my requests?


I had a look and this post is already covered with the changes I made and with the new library hook points I have added.

Nothing has changed yet in regard to your first post in that topic however.
Nice :)
Okay, thank you teraByte.
Love it love it love it. Thank you.
Good improvement. :thumbsup:
Nice improvement.... :)
World will be easier! :)
Sounds good and I hope there will be no changes at all so I can still can run ibProArecade Lite modification (if there were changes how would I update their encoded copy) on my site plus few other hooks.
Nice improvements. :)
Does this mean we have to be running php5.3>
Michael

Does this mean we have to be running php5.3>Michael



Not sure how you came to that conclusion from this blog entry but no :)

Does this mean we have to be running php5.3>Michael


PHP 5.3 is just an example of the minimum version I setup for that test hook in the screen, every modder is able to setup a different version :)
What about the ability to import multiple hooks at once?

What about the ability to import multiple hooks at once?


Still single import as usual, I didn't even consider such option until you mentioned it in your reply above.

For the most part people will import a lot of hooks at the same time and then another 2-3 hooks each time, I don't feel it's worth the time coding a multi-uploader for hooks when we can use the same time to improve other sections that need it a lot more.