![]() |
Auto Resize large images in an IMG tag
Sorry about my bad english :rolleyes:
With this small hack, all large images in an IMG Tag will be resized after the site has loaded. With a click on the resized imge, it will open in an new window with the original size. Works in Firefox, Opera, IE and i think in all other browser. Here is a Demo: Link Work with vB 3.7.x INSTALLATION: -------------------------------- - Copy the file resizevbimg.js in the dir clientscript. -------------------------------- Open the file includes/class_bbcode.php Search the line(~line 1932 ): Code:
return '<img src="' . $link . '" border="0" alt="" />'; Code:
return '<img src="' . $link . '" border="0" alt="" id="vBCodeIMG" />'; -------------------------------- Styles & Templates > Search the SHOWTHREAD Template Seach: Code:
<body onload="$onload"> Code:
<body onload="$onload;vbImageResize()"> -------------------------------- Styles & Templates > Search the newreply Template Search: Code:
<body$onload> Code:
<body onload="$onload;vbImageResize()"> -------------------------------- - Styles & Templates > Style Manager > Common Templates > headinclude Search: Code:
<!-- / CSS Stylesheet --> Code:
<script type="text/javascript" src="clientscript/resizevbimg.js"></script> -------------------------------- Styles & Templates > Style Manager > Main CSS > Additional CSS Definitions After, add: Code:
.vbimgcodelimit { -------------------------------- Done :) |
Nice, it's almost as spleasure's resize mod.
Is there any way you can choose the minimum size that the mod resizes? |
i think THIS is better :)
|
That's for 3.6 this one is specially made for 3.7...
Don't be an ass. |
Quote:
I don't need and want for img resizes DB queries. ^^ |
Quote:
Quote:
|
Quote:
Open the resizevbimg.js with an text editor and change the two values (500 is default size) to your new minimum size. |
is there any way install whit out all that edits ?
|
No there isn't. The instructions are very easy to follow.
Nice add on. Regards Jason :) |
is it compatible with vb 3.6.8 ?
|
thanks a lot works beautifullly
|
[high]* projectego clicks install :)[/high]
|
looks promising.. is there a way to add a "click to enlarge" ? i dont think many will relize you can make it bigger..
a light box add on would be really cool too :) |
Ok, it's got a downside... when clicking pictures that are linked to something, it shows the full image but also goes to the link... that's not very nice.
Good work on it, but i think i'll switch back. |
can you add a message like "click here to enlarge the image"?
|
Nice, works on 3.6.8 PL2
Thank you. installed! |
ive been searching for a working image resize mod for vb 3.7 b5 for a long time
and yours work thanks alot |
1/ Can you create this mod with lightbox intergration?
2/ Then, can you intergrate this mod with this hack https://vborg.vbsupport.ru/showthread.php?t=173353 ? |
thank you for an excellent mod. works like a charm on 3.7 Gold.
|
thank you man
can you make it open the resized image in the same window? is it possible avoiding opening any link included within the image location link? thank you for your nice work :) |
Quote:
|
Erm, you can just use a couple of lines of CSS to do this...
|
Hey, the SHOWTHREAD_SHOWPOST must get the onload extra code as well ^ ^
EDIT: And the same with adv_portal if you're using VBA |
Will this also resize images in a users photo album?
|
Quote:
I was looking for this :eek: Thank you, Installed!!! |
Ok I have edited the values in the JS -
Code:
var vbimgcodeWidthMax = 800; |
Don't forget the template SHOWTHREAD_SHOWPOST ;)
(added the script to load on that as well myself : ) , just a heads up) I like this script and if you want to change how it works people, then you should edit the javascript file, as that both contains which size it resizes the image to, by default 500x500, and also a default message. Snip of what resizevbimg.js includes: Code:
var vbimgcodeResizeMsg = 'Resized image! Click for original size!'; Code:
var vbimgcodeResizeMsg = 'Click here to enlarge the image'; |
Hey, just need to check - once this is added it won't give birth to the security token error?
Has the line of code been added so that it works with the security token feature? Just been having a lot of issues with this + mods Thanks! |
hack reinstalled on multiple themes on a 3.7.2 forum. works like a charm.
|
It doesn't resize PNGs???
|
This was exactly what I needed.. thank you. :)
I don't know why it's not included with vB "out of the box" at least as an option since it makes so much sense if you allow [IMG]. |
works great on 3.8.2
|
works on 3.8.3
|
|
In which way do I have to edit the SHOWTHREAD_SHOWPOST so that this add on works with it?
|
i tried this and it doesn't work. what am i doing wrong?? i have 3.8.2
|
Quote:
|
can someone do the coding for this for 4.0.7?
|
ah well
|
All times are GMT. The time now is 02:45 AM. |
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:
|