View Full Version : Code Hacks vs. Plugins


mf
26th October 2006, 09:05 PM
I tried the plugin system a few times but for everything I wanted to do I ended up writing a hack instead. I realize this is very impractical when upgrading, but the hooks are just in the wrong place!

Of course hook locations are hard to choose and you can't satisfy everyone, but take a mod_rewrite SEO hack for instance. If you want to do this in a plugin (change all the links according to your rewrite rules), you're left with few hook locations, the scope of which will be too global, and what you're doing is a search & replace on a lot of output code, which is inelegant and processor intensive, for things you can do with variable changes in a code hack.

It appears to me that if you wish to really *modify* any core part of vBulletin elegantly and with performance in mind, you're stuck with code hacks.

Now instead of hearing only from people who have switched to writing/using plugins (I realize they are popular), I would also like to hear from the diehards that still write, use, and maintain (the toughest bit, with all the security patches and new versions) actual code hacks.

Chroder
27th October 2006, 05:53 AM
Almost everything I have ever tried can be done with plugins. If you always (emphasized because obviously there are times where hooks won't do) find yourself using codehacks then you're probably not looking at the code in the right way. The hooks might not be in the exact location you would normally put your code, but they are usually placed before, inside and after any control structures so it often doesn't matter. Not as elegant as codehacks, but usually it can be done.

I'm not sure how many diehards you'll hear from because the majority of codehacks can be converted into plugins. And if it's a larger/complex hack, then there should only be small parts that still require codehacks.

There are some specific locations I've noticed lack some hooks and it took some clever workarounds to get out of a code hack. Then theres the times where only a codehack will work, but that number decreases with each vB release.

Re seo: vBulletin caches all output to a buffer anyway. I'm not sure that a replacement on all content at once would be any slower then running lots of replacements on smaller bits of content over and over again. And since you need to gather extra information (user names, for example), then it's best to fetch all the info you need from the database all in one go (single query) instead of fetching the same information many times for each smaller block of text.

onlinedesitv
29th June 2007, 03:46 PM
o cool thanks

ishansoni
30th June 2007, 08:44 AM
good info bro keep itup

Kyo
3rd July 2007, 03:45 PM
D: I never owned an vBulletin.