![]() |
Resize large [IMG] images and link them to original
This mod should resize [IMG] images wider than 'max_width' and link them to their original size. Not very well tested, i'm hoping for some feedback/suggestions. I have tested in firefox/IE latest versions and it seems to work fine. Should be a pretty quick install.
INSTALL: 1) Edit /includes/class_bbcode.php around line 1879 for me. Look for: Code:
return '<img src="' . $link . '" border="0" alt="" />'; Code:
return '<img src="' . $link . '" border="0" alt="" class="img_tag" />'; Code:
<if condition="THIS_SCRIPT == 'showthread'"> |
Demo/screenshot please.
|
will this also resize sigs in the [IMG] tags? if so can you prevent that. thanks.
|
Quote:
Quote:
|
You can demo it on http://www.timesharetrap.com/forums/...tyleid=1#post7
|
Quote:
|
because some of my members use sigs like 650x650 & it still resizes those. I just want it for pictures in threads.
|
the other img hack wouldnt do that. I like this one alot better so hopefully you can add that as an option ;)
|
Updated, so the images are hidden until the browser actually resizes them. (This way you don't see the page loading with big images and then all of a sudden shrink to the right size.)
|
Sorry teedizz i don't think i'm going to add that change. Doesn't make sense to me. No reason to resize images in the post if you aren't going to resize images in the signature as well. Whole point is to NOT break your design.
|
id doesn't work on my forum, as soon as I write down the headinclude text all the images in my forum won't show up anymore.
Marco |
Hi,
I've almost tried all image resizing hacks and will install this one soon. Note: You should also consider this adding for private messages, too: <if condition="THIS_SCRIPT == ''"> |
I tried it because an upgrade killed my old fix and I can't remember which version I had installed...but it wrote the dimensions into the html so that they were resized as they were downloading. I liked that better than a blank page till all are downloaded.
I also added a link target to your code so they don't open in the same browser. |
Quote:
|
Quote:
firefox and winxp sp2 Marco |
Quote:
There should be 2 images in that thread. |
doesnt work at all. Infact it removed the images instead of making a link
|
hmm strange. guess i'll take out the part that hides the images until they resize then.
|
any news? as soon as I try to install this hack when I send the post the image disappear instead of showin the link for the resized image.
Marco |
Quote:
|
This is the fastest way to resize giant images (vBulletin 3.6) if you don't mind the "click to view the full version of the image" feature:
https://vborg.vbsupport.ru/showpost....&postcount=144 |
just in my forum, cause when I look @ that link you gave me it works fine
Marco |
Quote:
Same here, using Safari on a Mac. |
Quote:
|
Quote:
|
Resize in News in VBadvanced???
Thx |
Quote:
|
Quote:
why should it work now? i already tried to reinstall the hack twice or three times... there's no way it will work now if you haven't change sometin in the code Marco |
Quote:
Just look for the: <style>#img_tag { display: none } </style> part and remove it from the headinclude template. |
Quote:
well tha reason i ask is because I allow usres to have sigs 600x350 which doesnt break my design. on the other hand I have members who add pictures to threads which are like 1568x900 which does break my design. for instance, we have a thread named " post your desktop " & people are literally just taking screen shots & posting the whole thing. if this doesnt affect a sig thats 600x350 thats wrapped in [img] tags then i will install. thanks. |
Quote:
where do i found this code? listen this is the fourth time i try to install this hack, i put the code in the class_bbcode.php, then the other code in the headinclude at the begin of it and the images won't work anymore... as soon as I get off the headinclude code everything restart working... Marco |
Quote:
<style>#img_tag { display: none } </style> is part of the code you added to the headinclude template. Remove <style>#img_tag { display: none } </style> and it SHOULD fix it. |
Quote:
|
Quote:
thanks for helpin me, and sorry if I seemed upset or what, i didn't want to ;), but for real I can't fine the tad you tell me to remove... :confused: Marco |
Finally a product that works me with my forum integrated in the portal... ;)
Possible ? to make to see a notice when the image resize? Thanks 1000 |
Quote:
"Sorry." How about a browser-detect instead, where visitors using those browsers see the original? |
This hack has promise, but is it possible to set both the maximum width and maximum height in the code - remembering that very 'tall' images can also be very annoying in making threads much longer than they have to be.
Also, I notice in Firefox 2 RC1 when you click on the image in the test link you provide, it goes to the enlarged image rather than either showing the image enlarged in the current thread, or opening the larger image in a popup. |
Quote:
Code:
var strNewHTML = '<a href="' + img.src + '" target="_blank"><img width = "' + max_width + '" src="' + img.src + '" border=0 alt="" /></a>'; Code:
var strNewHTML = '<a href="' + img.src + '" target="_blank"><img width = "' + max_width + '" src="' + img.src + '" border=0 alt="" /></a><br />Image Resized Down'; |
Quote:
Also, it shouldn't make any images dissapear (anymore). It should either resize or NOT resize depending on whether the browser understands the javascript or not. |
Quote:
Quote:
|
All times are GMT. The time now is 02:38 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:
|