The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Dynamic Picture Resize for [IMG] tag Details »» | |||||||||||||||||||||||||
If an image submited by a user (using the [IMG] bbcode tag) is to big, chances are that it will break your current vBulletin style. This hack will dynamically resize that image to acceptable dimensions, that you previously specified. It will do it for pictures inserted into postbit or user signature.
The code modifications listed below were tested into a clean installed vBulletin board. They work 100%. Installation In order to perform an efficient modification of your files, I recommend you to use Komodo Edit or Textpad. Both editors will allow you to complete all steps without any coding errors. You will need to make one small change for each of the following files: ? vbulletin_global.js (folder /clientscript) ? class_bbcode.php (folder /includes) Make sure you modify, save and upload one file at the time to your server. Then, simply run the product-dynamicpic.xml file. Once the product installed, don't forget to enable it. Go to your vBulletin Options, click on Dynamic Picture Resize setting group and set all your options. If you encounter any problems, feel free to post in the support thread. Learn how to open the image into a new tab/window. But you should stop using the target tag, since it will be deprecated soon. There is a reason why all browsers have now the Shift and CTRL options to open a new tab/window with the link you click on. Show Your Support
|
Comments |
#42
|
|||
|
|||
Quote:
Also, check out $bbcode->do_parse() and the other subsequently called functions, because it is entirely possible to accomplish this mod without using any file edits (which I'm sure everyone would like). I'll install it such on my site and post the code when I am done. |
#43
|
|||
|
|||
Got it to work sorry! Forgot just to set the vBulletin Options!
Quote:
|
#44
|
|||
|
|||
I am a fan since HOMELITE for VB2 Definistely INSTALLED thanx TECK miss TECKWIZARD.com |
#45
|
||||
|
||||
Quote:
Personally, I will never use this approach. Inserting the code directly is way faster then using it on a hook. Plus, you will need to use all kind of preg_replaces in order to isolate the link. I never understood why the hook obsession, they actually slow your server... a lot. Who cares if you edit the file and add a small piece of code. I challenge you to show me a better and faster way, compared to the code I made. If you win, I pay the beer... |
#46
|
|||
|
|||
Okay, here are the updates:
In total, there may be 1 additional preg_replace, because the plugins bypass the original IMG bbcode handler. And the template is not eval'd on its own, keeping speed in mind. Changes to the product file:
This is why my site only has one plugin for each hook, with one line of code each. This include()s plugins saved in the file system. I think I halved load times by spending a week doing that. |
#47
|
||||
|
||||
Something really big is coming... in few months.
A new teckwizards site will evolve... be prepared. |
#48
|
||||
|
||||
I win! You replaced my 4 lines of code with 285 execution processes.
However this is a very good solution, for people who don't want to edit their files. Now, pay the beer! I'm in Montreal. |
#49
|
|||
|
|||
Hey tech long time no chat , nice hack got a client been looking for something like this for his blog
|
#50
|
||||
|
||||
Quote:
I suggested that to vBulletin team also, for their products. In Project Tools and Blog I replaced all their hook code with files. While doing some benchmarks to emulate 10,000 users hitting a server, the results were shockingly better, compared to the code left in hooks. Glad I could help, Robert. |
#51
|
|||
|
|||
can you include a readme guide for updating from the previous version?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|