Jump to content

Invision Community Blog


Managing successful online communities

teraßyte
Sign in to follow this  
 

IP.Board 3.2.0 Dev Update: Hooks Improvements

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.

blogentry-126321-0-93070200-1298932189_t


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.

blogentry-126321-0-90545400-1298985461_t

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.

blogentry-0-0-83409500-1298930976_thumb.

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.

blogentry-0-0-21699500-1298931164_thumb.

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.

blogentry-0-0-39782400-1298930970_thumb.


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/

blogentry-126321-0-22689300-1298976284_t 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.

blogentry-126321-0-75796900-1298976276_t


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.

blogentry-126321-0-68750500-1298976274_t



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!

Sign in to follow this  

Comments

Recommended Comments

[quote name='Ryan H.' timestamp='1299683043']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.

Share this comment


Link to comment
Share on other sites

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.

Share this comment


Link to comment
Share on other sites

[quote name='nortonz' timestamp='1299797255']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 :)

Share this comment


Link to comment
Share on other sites

[quote name='Fishfish0001' timestamp='1299964758']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.

Share this comment


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...