Jump to content
We are closed Thursday 23rd November and Friday 24th November. Support is still available via your client center but response times may be delayed.
Invision Community
Michael

Some ways to hook into stuff we can't today

Recommended Posts

Is there any possibility of you folks at IPS looking into ways for us to hook into some things we can't today, namely the various IPSMember methods or other static methods like those? I'm sure there are technical hurdles to allowing this, but with them being untouchable right now it restricts us mod makers from doing some things we might want to.

For example, there are two fairly popular hooks of mine for IP.Board 3.1 that I cannot upgrade to make work in 3.2 now due to the combining of avatars and profile photos: my Default Avatar and Identicon Avatars hooks. Those used to work on the principle that I could hook into the userInfoPane template and do my work of showing a new avatar, since that was the only place by default that avatars were ever shown. Now, though, avatars/photos are shown in tons of places, and there's no realistic way to hook into each one individually. So ideally what I'd like to do is hook into IPSMember::buildNoPhoto(), and use that function to show something else if I wanted to. But there's no way to get to that function right now.

Maybe some of the code could be moved off into library files that we could hook into? That way, IPSMember::buildNoPhoto (or others like this, that may need to be hookable) can still be called like normal, but they return the value from a library file, which can be overloaded. I don't know if this is even feasible, but I'd like to hear if this may be something that can be looked in to. It seems that these static methods are showing up more and more in the product, so It'd be great if they weren't so black-boxed to us third party developers.

Share this post


Link to post
Share on other sites

PHP 5.3 makes it possible because you can do:

$var::method();



But < 5.3 (which we have to support) makes it difficult to do that without dropping the use of static classes, obviously static classes have their purpose.
That said, I personally feel IPSMember would be better suited as a model (perhaps merged with ipsRegistry_member) rather than a static class, but of course, that's not something that will change soon.


For your specific mod, perhaps you could replace the default avatar image file with a php file?

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×