vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=295669

API Extensions (The New Plugin/Hook System) Question
by vbresults
02 Mar 2013 12:48

How can we intercept the methods we're extending, instead of having our extension methods invoke after the parent methods?

I.e.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Also how do I extend classes outside the vB Extensions Api folder, like controllers?

ForumsMods 02 Mar 2013 14:55

Both are not possible for the moment.

vbresults 02 Mar 2013 22:08

Quote:

Originally Posted by ForumsMods (Post 2407382)
Both are not possible for the moment.

... then how are we supposed to make mods without butchering the core software and making it difficult to install a mod?

ForumsMods 02 Mar 2013 22:28

Well, for the moment, you need to find a way (workaround) to do what you want.

Maybe you can extend another method that is called before save() finishes.
Maybe, you can create another controller to do what you want.

If you explain what you want to do, we will able to be more help.

Limitations to modifying vB5
  • You cannot run any extension method before its main API counterpart.
  • You cannot stop or change core API calls (for example those that make database updates).
  • You cannot alter or hook into existing database queries.
  • You cannot extend library functions.
  • You cannot extend or hook into any frontend functions.
  • You cannot access the actual API variables ($this->xxx)
  • You can't extend any API call that was called by instanceInternal()
  • Cannot hook into [most] ACP functionality.

If you have any others, please post them

vbresults 02 Mar 2013 23:41

Quote:

Originally Posted by ForumsMods (Post 2407450)
  • You cannot run any extension method before its main API counterpart.
  • You cannot stop or change core API calls (for example those that make database updates).
  • You cannot alter or hook into existing database queries.
  • You cannot extend library functions.
  • You cannot extend or hook into any frontend functions.
  • You cannot access the actual API variables ($this->xxx)
  • You can't extend any API call that was called by instanceInternal()
  • Cannot hook into [most] ACP functionality.

Jesus Christ! Why even have a modification system, then?

Thanks for this list, though. We just aren't developing any more vB5 mods until these things are taken care of.

ForumsMods 03 Mar 2013 01:27

Quote:

Originally Posted by Paul M
With two completely new systems (to replace plugins and template hooks [v1]), its obvious that we are going to find limitations to what can be done.

You can vote in the issues created in Tracker to get these "bugs" fixed faster.

Ben.Smith 24 Apr 2013 12:21

Hi,
i am pretty new to vBulletin as we got a customer who insists on using vB 5 Connect....

Having a quick look at the vB Code (horrible!), i came to the same conclusion: There is no good way of modifing specific behaviors in vB without making changes to the core files thus losing the possibility to upgrade.

Sadly vB missed to implement some kind of event/hook system (sorry but these Template hooks just don't give enough flexibility for big changes).

I went to make use of the existing autoloader and modified both - index.php and api.php to always look (following name convention) if there is a custom implementation of the loaded Class.

Now I can easily override every Frontend Controller and API Class to integrate my own logic.

Its not the best way, but as far as i can see its the only way to go right now.

Anyone here tried something like this before?

CvP 28 Apr 2014 21:51

Can you share/explain this in detail?

Paul M 29 Apr 2014 00:54

You realise that post is a year old ?

CvP 29 Apr 2014 01:26

Yes, but even this would help more than the non-existing vb5 documentation...

YankForum 14 Aug 2014 10:50

and still it's not possible to modify core methods and classes?
a child class can not be helpful here while i need to modify parent methods withough changing core files directly!

Paul M 14 Aug 2014 12:53

No changes have been made at all as far as extentiosn etc are concerned.
Other things seem to take priority, so I doubt anything will change anytime soon.


All times are GMT. The time now is 15:03.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.