![]() |
Auto Resize Your Images 3.52 compliant
I was looking for some code that would allow an image over size x to be resized in IE, Firefox, and Opera. I tried all the variations out there without luck some would work in IE, some in Firefox, etc.. So I finally got a tweaked version of some old code that actually works flawless in IE, Firefox, and Opera. I have included it below, but It needs 1 final tweak that I'm hoping someone in the community can help with.
i am NOT taking credit for this hack, all I have done is tweak it to get it working for me.. This code has been updated as of 8:30pm with the clickable link built in now! Step 1: Edit your class_bbcode.php file located in (root/includes) find PHP Code:
PHP Code:
|
change:
Code:
/* Start Image RESIZE */ Code:
/* Start Image RESIZE */ |
Actually you do not need the Java, it was a left over routine from an older version.
Thank you for you addition to this hack.. I truley believe this is the best auto-resize for vbulletin 3.5+ Now we need to add a Click here to enlarge text over the image! I have tested and modified the code at the top.. any additions or modifications to make this better please let us know! Otherwise enjoy! Example is at http://www.gamereports.net/showthread.php?p=167#post167 |
Not resizing in Opera. IE looks great.
|
Here's a modified version with "Click to enlarge image" text on top/bottom...Just a quick edit...
PHP Code:
|
This is weird, but my /includes/class_bbcode.php does not have this line at all, or even parts of it in any shape or form:
Code:
return '<img src="' . $link . '" border="0" alt="" />'; |
Work but if I quote a message with the image the writing it appears "click to..." repeated.
|
Quote:
Try searching with the return ' part I didn't try that quoting thing... I'm gonna go check that now. Joel |
This looks pretty good and I'll most likely install it tomorrow.
..mind if I ask where you got a working link hider for 3.5.2? Quote:
|
Thats the best one from all I tried before! thanks
|
Nice hack, but couldn't it be possible to change this into a plugin? Using the hook bbcode_parse or something?
|
Hi,
Thanks for the hack.. isn't it suppose to resize large images only.. as if I use it, every img in the post becomes clickable, and if I use joelabq addition, every ims wil be contained in a box with click to enlarge :ermm: .. Regards |
does this work also when you use the Manage Attachments feature ??
|
@sgtmaj its not for attachments its for hotlinked images with [ img ] tag
|
Quote:
|
ignore, sorry.
|
This MOD will also make images smaller then the size I have filled in linkable.
And so when I have images from the VBB board showing up at my main site (non-vbb) and I got an border arround the images telling them to click to enlare, all the images will show that. |
Hello guys,
I've tried your hack, it works perfect in IE but it didn't work with Firefox 1.5 :disappointed: Any idea ? best regards Andreas |
clicks install.. or something like that.. thanks guys...
|
it seems didnn't work in case you have attached your image and make it hotlink likes:
[img ] http://blablabla/attachment.php...blabla [/ img] anyone can solve this? |
Does this work on v. 3.5.3?
|
Quote:
|
Quote:
|
Anyway to make this work with Opera browsers?
And there's a problem with imageshack. When you post auto generated thumbnails from imageshack, they stop working. When you click on them they just open the thumbnail instead of the real size image. I'm talking about these kind of imageshacks thumbnails: http://img280.imageshack.us/img280/8...x0014ck.th.jpg When you click on this one it'll open a big image in a new window. But after I added this resize hack, those thumbnails stopped working. They just open the thumbnail again. Any way to fix this? |
Installed and it seemes to work :)
|
Since we run a board that supports two languages, i've added a little tweak and made the alt-tag a phrase. Use if you will :)
Code:
/* Start Image RESIZE */ find: function handle_bbcode_img_match($link) { and add right under: global $vbphrase; Ow, and don't forget to add this phrase offcourse Enjoy :) |
Quote:
|
I see people installing it and saying it works in browsers other than IE. There is no way it does. I looked at the creator's site on the three browsers and it did not work on anything other than IE. I just installed on my board and took it off, as it DOES NOT work in Opera or Firefox.
Can someone fix it? I really kind of need it but only if it's cross-browser. it worked so well in 3.0. Also, I have $20 Paypal for anyone who can integrate this, correctly, with the "click on it to see a larger image" and the ability to hide IMG images from Unregistered users. Both were available on 3.0 so it's a straight port. |
I just installed it. I can't speak for the creators site, but it works fine for me in FF 1.5 in windows as well as 1.5 for linux on my site
|
Codeman, yeah, just checked again, it does work in 1.5 Firefox. Still not in Opera. Goes out of screen. The offer def. still stands for someone who knows how to do this right.
|
Does anybody know if there's a way to only resize and add a link if the image realy IS wider than the specified width?
|
I have been begging in several places on this site, and have offered some $$ for a script that equals the 3.0 version that was FLAWLESS. This one makes all into links, and does not resize properly, and plain does not do anything in Opera.
I thank ggiersdorf for the start, but I really wish someone would step up and finish it up. I just got a copy of the "no img for guests" finally, with a plugin and very solid. |
Sorry guys I have been out of town for a while, just got back apfparadise what is your site?
Pm the info if you wish I will take a look and see if i can help.. |
This line is not in my class_bbcode.php im using 3.5.2
return '<img src="' . $link . '" border="0" alt="" />'; |
Bashy, the line is there, unfortunately the spacing in the post above is a bit different, so when you do a search it does not come up. Look for it manually. Took me a while too, but it's there.
ggiersdorf, I dont have it on right now, so going to my site wont help you. These are the concerns you have to look for, check them on your board too, they should be there. 1. The images that are within your set parameters should NOT be clickable, only the ones that are bigger and getting resized. 2. The images do not get resized properly. In Opera, there is no resizing for anything, just does not work, I have tried different sizes. 3. Below is a link to the 3.0 version that worked PERFECTLY I ran on my site for a long time. IT's the only one I know of that works every time. I think the new build has to start by looking at it and following that strategy. May talk to the original owner, I have asked about a port but did not get a reply. https://vborg.vbsupport.ru/showthread.php?t=67743 BTW, I am on AIM, APFparadise. If you want to do a session I will install it quickly ( I have the edited file on my server, just need to rename 2 files) and you can take a look at it, I just dont want to run it on the site long term till it's done. |
thanks apfparadise
That sorted it :) Clicked install :) |
I've taken some of the code of the old hack and mixed it with the new code.
The image will now be left alone if smaller than the width you specified: Code:
Deleted old code |
OK, found out that I've introduced error messages on forumpages when the image wasn't found. So I ripped some more code from the old hack by Steve St.Lauren and added it to the new code by ggiersdorf.
Seemes it works fine now :) Code:
Check the revised code in post #52 |
S@NL -thanks for the work, almost there. Still does not work in Opera, it links the file but does not resize it. The other two browsers are spot on, I changed the size to 800 px so maybe I made a mistake. I changed the first one that says "If image is more than ..." and made 800 and then I changed both browser options to 800 (the IE one is 800 ? 800 right?) and it works fine on IE and Firefox, but not Opera.
Also, what is the phrase for resizing supposed to do, it does not show it anywhere. I thought it would be a text line under the image to show that it should be clicked. Also, I am not sure, but can it be made when the image is not available or the server times out for it to show an image? I created two images like this: https://vborg.vbsupport.ru/ and https://vborg.vbsupport.ru/ Can they be shown if there is no image? again, thx for this. |
hello...its a really hack...been long time looking for one that works propely..
as i saw here image hosted on other site like imageshack or photobucket.. will that image also be resized as per my requairment? also lots of CODE here..kinda taugh to reliasize which one is for what? just any one can tell me.. will this hack re-size/clikable image that hosted on imageshack works on IE,Opera,FireFox.. Waiting for help Thankx. |
All times are GMT. The time now is 10:22 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:
|