Some ways to hook into stuff we can't today
Posted 17 September 2011 - 11:10 AM
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.
- blair, Logan, AndyF and 6 others like this
Posted 19 January 2012 - 10:11 PM
Posted 20 January 2012 - 01:43 AM
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?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users