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 |
#32
|
||||
|
||||
Yes, the hack is dedicated to you and to Lizard King... also.
We will talk here. It will be a good learning experience for users, since we will talk about code. OK, I took 2 screenshots, in FF... it is working perfectly. Tell me if I missed something. |
#33
|
|||
|
|||
TECK, you may think i'm crazy but it was not working a few hours ago. Both me and Lizard King tested it on IE, Firefox, Opera and Safari.
Somehow... it's also working on Firefox now.. really weird... (of course i updated my browser cache) Anyway... my final request is being able to see the resized images in a new browser window (or tab) when i click on it. |
#34
|
|||
|
|||
Floren try on here http://www.ayyas.com/blog.php?b=787 we both have the same file edits and css however this is not working.
|
#35
|
||||
|
||||
I see what you guys mean. Mert, when I click on Mina's picture, it should open so you can see the full size picture, right? It does not, currently.
Post what you guys did with the code, you broke it nice. You have to add the class in the JavaScript code. Let see how you did it... |
#36
|
|||
|
|||
class_bbcode edit :
Code:
return '<img src="' . $link . '" border="0" alt="" class="imageresize" onload="resize_image(this, \'' . $link . '\', 540);" />'; Code:
* @param string Image object * @param string Image link * @param integer Image max width */ function resize_image(obj, link, maxwidth) { if (obj.width > maxwidth) { obj.style.cursor = 'pointer'; obj.style.width = maxwidth + 'px'; obj.style.height = parseInt(obj.height * maxwidth / obj.width) + 'px'; obj.onclick = function() { window.location.href = link; return false; }; } } HTML Code:
.imageresize { text-decoration: none; padding : 4px; border : 4px solid #eeeeee; max-width: 540px; width: expression(this.width > 540 ? 540: true); } |
#37
|
||||
|
||||
Version 1.0.1 released. Code improved related to initial image resize.
http://67.68.90.251/forum/showthread.php?t=3 Do a CRTL + F5 to see what I mean. Ya, you can do it in Firefox also. |
#38
|
||||
|
||||
Quote:
https://vborg.vbsupport.ru/showpost....53&postcount=6 |
#39
|
|||
|
|||
Didn't work for me, im not sure where Should I insert the css if a screenshot is avaible please ^^
|
#40
|
|||
|
|||
You are my hero
Works great now! |
#41
|
||||
|
||||
Quote:
Guys, anyone with IE6 can test the link and see if it's working as it should? http://67.68.90.251/forum/showthread.php?t=3 And I need demos from other sites, I will not keep up in public mode my server. I need to play with code and there are chances it will break from time to time. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|