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 |
#52
|
|||
|
|||
Quote:
Quote:
|
#53
|
||||
|
||||
Quote:
People will ask all the time for support on a piece of code that I did not make... Thanks. |
#54
|
|||
|
|||
You suggest making file edits instead of using plugins? (for all products - hacks)
Yeah, it'll be faster but it'll also take so many time when upgrading... |
#55
|
||||
|
||||
It will take you 30min max to upgrade a heavy modified board... if you know what you are doing. Plus the difference between editing directly the files, compared to hooks usage, is huge. Even the vBulletin developers said that writing the code directly to files is way better then using the hooks. Then, even if you use only hooks, there is no guarantee the code will still work on the new vBulletin version, so you are stuck already. While editing the code by yourself, you learn about PHP and see exactly what it has to be done, in order to fix everything.
The hooks are for people who don't code or are lazy to learn few basics in PHP. Then, why do you want to download hacks if you don't want to learn anything? And how do you know that the plugins you just installed will not destroy your server? Don't take it on a bad way, I simply state the real facts: using hooks is slowing down your code execution. That is compared on real benchmarks. Plus, I bet you 1 million dollars, no (or very few) "hackers" will test their code with benchmarks... just to see how their hack will perform under heavy server stress. You have no idea how many bad hacks you can find here at vBulletin.org site. The code thincom2000 made is good from a technical point of vue. But what do you think it will execute faster: my 5 lines of code grouped in one location... or his 200 lines spread all over the hooks and templates? Many people don't realize how bad it is to load your board with a lot of hook inserted code. I'm totally against modifying your vBulletin board. I don't see any need to add a ton of hacks that will not do any good to your server performance. But if I'm forced to do it, I will definitely edit the vBulletin files. I deal with a lot of clients, like corporate people. I build their server from scratch, including the OS with my own RPM's (PHP, MySQL, etc.) and all the needed software for high performance machine/s. Then, when I install vBulletin, I will always recommend not to insert any hacks on it. |
#56
|
|||
|
|||
Thanks for the detailed answer.
|
#57
|
||||
|
||||
Thanks and let me state this one more time: thincom2000 did a very good job on the code modification. This has nothing to do with my comments listed above. It is just my personal opinion about using code in hooks.
|
#58
|
|||
|
|||
For the ease of support and less confusion in this thread, I have taken TECK's suggestion and opened a support thread for the modified product file I posted earlier. The file is now only available in that thread.
https://vborg.vbsupport.ru/showthread.php?t=157428 Please repost your issue in the other thread, and I will gladly tell you how to fix it, since this was my very first issue when I took on the task of pluginifying it as well. |
#59
|
||||
|
||||
Good decision, Ted. Congrats on the mod, BTW.
|
#60
|
|||
|
|||
OK, if I am reading this correctly, when installed this will resize pictures as they are uploaded from the user's computer but before being saved on the server? However, they must be attached and not installed with [img] tags? Am I reading this right?
Johnnie |
#61
|
|||
|
|||
Johnnie,
When a user puts an image url in [IMG] tags, if the image is bigger than the size you have specified it will shrink the image and make the original image a link. Also, this works perfect for me. Installed. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|