Rasmus Vind
Well-known member
I am looking into extending the attachment system with more file types. My site has to do with lots of obscure formats. I would like to add thumbnails for those filetypes. This is something I am already able to do, but where do I put it in xenForo? I would rather not edit the original files, nor overwrite original methods with huge chunks of the existing code. Can't I attach something to the end of a function?
I have been looking into code event listeners which allows me to overwrite methods of instantiated objects. I am not so happy with that as I want the existing functionality to stay, but add more to it. I could copy paste the existing code into my own event listener, but that's ugly. I guess I could make a transparent class that overloads __get() and __call() but has an instance variable being the object passed to me. Then the transparent class can have a method I make. After calling it, it could call the original method.
Any better ideas?
I have been looking into code event listeners which allows me to overwrite methods of instantiated objects. I am not so happy with that as I want the existing functionality to stay, but add more to it. I could copy paste the existing code into my own event listener, but that's ugly. I guess I could make a transparent class that overloads __get() and __call() but has an instance variable being the object passed to me. Then the transparent class can have a method I make. After calling it, it could call the original method.
Any better ideas?