The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Easiest way to patch your own hooks into the vBulletin codebase?
vBulletin tells me that it's completely impossible to modify the contents of posts displayed in the Mobile Suite mobile apps, either by hooks or class extension plugins for the vB5 back-end (which serves the contents to the mobile apps through the API requests that these apps make to it).
Based on this information, my only remaining alternative is to patch the vBulletin code myself, and the cleanest way I can think of is to insert my own hook point(s) into the vBulletin source code and then reference these from an extension/product, thus causing minimal patches of the vBulletin code itself, which can be repeated for future released versions of vBulletin as easily as possible. My question is therefore: What is the easiest way to patch your own hooks into the vBulletin codebase? Is there only some single line of code I can insert at the location in the code that I want to hook? Is there perhaps even some examples available somewhere that I could take a look at in regards to this topic, that anyone knows of? |
#2
|
|||
|
|||
The vBulletin 5 documentation is pretty poor so you'll probably have to figure most things out yourself. In the code the only reference to invoking a hook seems to be function invoke($hook_name, $params) which can be called using (an example taken from the new login hook):
PHP Code:
By default vBulletin 5 comes with a couple of packages/products that interact with these hooks so you can see what kind of code you can put inside of hooks and how the params are passed to the hooked function. One example can be found at /core/packages/googlelogin/hooks.php and the other files in that folder. Hopefully that will help you out for now. |
#3
|
|||
|
|||
Hello Dave, thanks a million for this information, a very useful starting point for looking into this deeper, which I will absolutely do!
Do you (or anyone else here) know which PHP script in vBulletin that the Mobile Suite mobile apps use for their API calls? That would be a very good starting point for me to begin tracing/reversing code in order to know where to best place my new custom hooks... --------------- Added [DATE]1566948011[/DATE] at [TIME]1566948011[/TIME] --------------- Ok, a few moments of web server access log tracing and PHP code reversing later, it would seem that a good target for a custom hook would be the print_apioutput($data) function of the file /core/api.php. I'll start gently and try to use the hook methodology listed above to insert a hook in it. If it won't work, I'll just patch the hell out of it locally for now, since I've got no time to lose in this matter. I'll let you know how it goes! PS. I assume that it won't be possible to use the new fancy-schmancy subclassing extension system of vB5 to get direct access to this function directly from a "product" without any code PHP file patching having to be done at all? Seeing that: 1) This function (print_apioutput()) isn't even inside any object oriented code to begin with. and 2) What are the odds of that working as advertised to begin with either way, right...? Or would that actually be able to work somehow? Anyone knows, yes or no? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|