Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 02 Mar 2013, 12:48
vbresults vbresults is offline
 
Join Date: Apr 2009
API Extensions (The New Plugin/Hook System) Question

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?

Last edited by vbresults; 02 Mar 2013 at 13:55.
Reply With Quote
  #2  
Old 02 Mar 2013, 14:55
ForumsMods's Avatar
ForumsMods ForumsMods is offline
 
Join Date: Aug 2007
Real name: Adrian Sacchi
Both are not possible for the moment.
__________________
Adrian Sacchi - Forums Mods
vBulletin Alpha/Beta Tester
vBulletin Bug Scrubber
Reply With Quote
  #3  
Old 02 Mar 2013, 22:08
vbresults vbresults is offline
 
Join Date: Apr 2009
Originally Posted by ForumsMods View Post
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?
Reply With Quote
  #4  
Old 02 Mar 2013, 22:28
ForumsMods's Avatar
ForumsMods ForumsMods is offline
 
Join Date: Aug 2007
Real name: Adrian Sacchi
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
__________________
Adrian Sacchi - Forums Mods
vBulletin Alpha/Beta Tester
vBulletin Bug Scrubber
Reply With Quote
  #5  
Old 02 Mar 2013, 23:41
vbresults vbresults is offline
 
Join Date: Apr 2009
Originally Posted by ForumsMods View Post
  • 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.
Reply With Quote
  #6  
Old 03 Mar 2013, 01:27
ForumsMods's Avatar
ForumsMods ForumsMods is offline
 
Join Date: Aug 2007
Real name: Adrian Sacchi
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.
__________________
Adrian Sacchi - Forums Mods
vBulletin Alpha/Beta Tester
vBulletin Bug Scrubber
Reply With Quote
  #7  
Old 24 Apr 2013, 12:21
Ben.Smith Ben.Smith is offline
 
Join Date: Apr 2013
Lightbulb

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?
Reply With Quote
  #8  
Old 28 Apr 2014, 21:51
CvP's Avatar
CvP CvP is offline
 
Join Date: Aug 2006
Can you share/explain this in detail?
Reply With Quote
  #9  
Old 29 Apr 2014, 00:54
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
You realise that post is a year old ?
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #10  
Old 29 Apr 2014, 01:26
CvP's Avatar
CvP CvP is offline
 
Join Date: Aug 2006
Yes, but even this would help more than the non-existing vb5 documentation...
Reply With Quote
  #11  
Old 14 Aug 2014, 10:50
YankForum's Avatar
YankForum YankForum is offline
 
Join Date: Mar 2010
Real name: alij
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!
__________________
No more signature for me , Tnx!
Reply With Quote
  #12  
Old 14 Aug 2014, 12:53
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
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.
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 06:36.

Layout Options | Width: Wide Color: