Version: 1.0.1, by TECK
Developer Last Online: Nov 2023
Category: Show Thread Enhancements -
Version: 3.6.8
Rating:
Released: 09-06-2007
Last Update: 09-07-2007
Installs: 165
Uses Plugins
Code Changes
No support by the author.
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:
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
This modification may not be copied, reproduced or published elsewhere without author's permission.
You are person no. 2 who requested the above feature.
Keep in mind this: There is no way (for now) to separate the [IMG] bbcode from actual postbit and signature. In other words, if you have a message because the image is resized, this message will show anywhere, including the signature, which will make users upset.
I will definitely not edit the code in several vBulletin files, just to avoid this feature in the signature... so be aware what you ask for.
Actually, there is a way. When $bbcode->parse() is called, the parser checks whether we are in the calendar, a pm, signature, etc (stored in $forumid). Directly afterwards the bbcode_parse_start hook is called, which you can in turn use to store this info in a way that can be passed to your function.
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.
Got it to work sorry! Forgot just to set the vBulletin Options!
Quote:
Originally Posted by thincom2000
Actually, there is a way. When $bbcode->parse() is called, the parser checks whether we are in the calendar, a pm, signature, etc (stored in $forumid). Directly afterwards the bbcode_parse_start hook is called, which you can in turn use to store this info in a way that can be passed to your function.
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.
Actually, there is a way. I'll install it such on my site and post the code when I am done.
Glad to see the hackers are still sharing their knowledge.
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...
added vBulletin Option for a "this image has been resized" message
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:
Added 3 plugins
Added 1 template (scroll to bottom for CSS)
Added 2 settings
Quote:
Originally Posted by TECK
I never understood why the hook obsession, they actually slow your server... a lot.
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.
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.
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.
Good call, I like your thinking. That is exactly what I do also... Lizard King can confirm how many times I insisted on this matter, for his site.
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.
Quote:
Originally Posted by PixelFx
Hey tech long time no chat , nice hack got a client been looking for something like this for his blog