![]() |
Image auto resizer
Hello :) first post \o/. I'm a long time vB lover/coder, first time poster here (having purchased my own liscence earlier... no more hanging off friend's forums for me).
Brief outline: This mod is designed to prevent images horizontally stretching the screen, while giving you the ability to revert them to their full size if you wish. How does this affect the user This is a silent script - after its installation, there is no configuration or further modification required. Lets see it then! There are two images of the mod in action attached. What versions will this support? Defiantly 3.5.3 and 3.5.0 (I believe it was RC2) although it was a slightly different string you needed to search for in the php file, but it's in essentially exactly the same. I imagine that with a little messing around, it'll support earlier versions also. Installation: First, download the attached zip file (autoresize.zip). A copy of these instructions are also there. Upload autoresize.js to /clientscripts/ from your forum directory. Log into your forum admin panel, go to styles & templates > style manager > edit templates. Edit the "SHOWTHREAD" template (Under Show Thread templates), find </head> Just above it, add Code:
<script type="text/javascript" src="clientscript/autoresize.js"></script> Repeat, adding it in the same place to the newthread template. Now, from your forum directory, open /includes/class_bbcode.php search for: Code:
return '<img src="' . $link . '" border="0" alt="" />'; Code:
return '<div style= "display: none; background-color: black; color: white" onClick="catflap_toggle_image_size(this); return false"> </div><img src="' . $link . '" onLoad="catflap_resize_image(this); return false;" border="0" />'; Should this be the case, open /clientscript/autoresize.js modify the 100 in Code:
size_available = winwidth - 100; Enjoy! :) If you have any problems, just give a shout and I'll do my best to put you right. All feedback/suggestions are also welcome. |
Wrong forum. This is a "Code Modification".
|
For me, the forum is the right ones.
Thank you for sharing your js script. :pirate: PcFreak |
Interesting, how about a link to a working version. I can't figure it out from the screenies. Does it open it in a new window as a full, or resizes it in the same window. What's the default state, resized or original? Does it work cross-browser? IE, Opera, and Firefox?
|
Quote:
http://www.timbashford.com/forum/sho....php?p=7#post7 |
Quote:
Link is up there :) |
unfortunately it doesn't works for me, i run vb 3.5.3, the bar says it reduced the image, but the image has still its original dimensions
|
the pics (bbcode) don't resize. And it does not show "Click this bar..."
I have got the default layout template 3.5.3 installed. Edit: works great - I accidently put the code before <head> instead of </head> |
Firefox 1.5.0.1 does not resize image. Note that if u whant use "style.width" u must specify width accoding to spec with dimensions eg not
Code:
imageref.previousSibling.style.width=size_available; Code:
imageref.previousSibling.style.width=size_available+'px'; |
width of the table or of the img??
|
All times are GMT. The time now is 07:30 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|