Version: 1.00, by Timmeh7
Developer Last Online: Dec 2014
Version: 3.5.3
Rating:
Released: 02-07-2006
Last Update: Never
Installs: 31
No support by the author.
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>
Give it a test, under different templates with different boundaries, it may well still stretch the table make the image a little/be a little too small.
Should this be the case, open /clientscript/autoresize.js
modify the 100 in
Code:
size_available = winwidth - 100;
either up or down (start by moving it up and down in 100's, then when it gets closer to perfect, 10's) until an image that would normally stretch the table fits completely within the forum boundaries. 100 is perfect for the default vbulletin 3.5.3 template.
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.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Hi, I modified the script this way, thanks to stcont, and it work perfectly in Firefox and Opera.
Code:
function catflap_resize_image (imageref)
{
var winwidth = 0;
var size_available = 700; //to set 700pixel as your max image size
if (self.innerWidth) winwidth = self.innerWidth;
else if (document.documentElement && document.documentElement.clientWidth) winwidth = document.documentElement.clientWidth;
else if (document.body) winwidth = document.body.clientWidth;
//size_available = winwidth - 600;
if (imageref.width > size_available)
{
var pc = Math.round (size_available / imageref.width * 10000) / 100;
imageref.catflap_original_width=imageref.width;
imageref.catflap_shrunk_width=size_available;
imageref.catflap_shrunk_pc=pc;
imageref.catflap_shrunk_status=1;
imageref.style.width=size_available+'px';
if (imageref.previousSibling)
{
imageref.previousSibling.style.width=size_available+'px';
imageref.previousSibling.firstChild.nodeValue="Immagine ridimensionata al " + pc + "% delle sue dimensioni. Clicca qui per vederla nelle dimensioni originali.";
imageref.previousSibling.style.display = 'block';
}
}
}
function catflap_toggle_image_size (imageref)
{
if (imageref.nextSibling)
{
if (imageref.nextSibling.catflap_shrunk_status == 1)
{
imageref.firstChild.nodeValue="Immagine a dimensioni originali. Clicca qui per rimpicciolirla.";
imageref.style.width=imageref.nextSibling.catflap_original_width+'px';
imageref.nextSibling.style.width=imageref.nextSibling.catflap_original_width+'px';
imageref.nextSibling.catflap_shrunk_status=0;
imageref.style.display = 'block';
}
else
{
imageref.firstChild.nodeValue="Immagine ridimensionata al " + imageref.nextSibling.catflap_shrunk_pc + "% delle sue dimensioni. Clicca qui per vederla nelle dimensioni originali.";
imageref.style.width=imageref.nextSibling.catflap_shrunk_width+'px';
imageref.nextSibling.style.width=imageref.nextSibling.catflap_shrunk_width+'px';
imageref.nextSibling.catflap_shrunk_status=1;
imageref.style.display = 'block';
}
}
}
Now I have another problem, if I load a thread with large image under IE, the first time tha script work nice, but if I reload the page it doesn't anymore. For example io con go here:
the image should load resized, try now to hit the reload button (F5) and as you can see the image are not resized any more, and from now on they never been resized any more.
Now I have another problem, if I load a thread with large image under IE, the first time tha script work nice, but if I reload the page it doesn't anymore. For example io con go here:
the image should load resized, try now to hit the reload button (F5) and as you can see the image are not resized any more, and from now on they never been resized any more.