vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Wide image automatic resize for html and vB tags in posts - fixes template problems (https://vborg.vbsupport.ru/showthread.php?t=67743)

twizted@dragonm 04-16-2005 01:34 AM

Works like I expected.. but... a little to well... I dont want it to resize my signature images..... Is there anyway around this or set it to a diff max width for signature images?

AndyA 04-18-2005 06:14 PM

Has anyone tested this on 3.0.7 ? I could do with a mod like this if it autosizes images and opens up full size image once clicked.

twizted@dragonm 04-18-2005 06:23 PM

I am running it on 3.0.7 myself.... but ... I need it to not resize my signature images :(... No one out there know how to keep it from it?? please....

Razasharp 04-18-2005 09:48 PM

Is there anyway to modify this hack so that if the image is too big the system simply does not allow the IMG tag but instead uses the URL tags?

That way the poster will in time, learn that large images are not acceptable. This works better than simply altering the image 'size' because the size of the image interms of bytes actually remains the same - and this is what we don't want, people on non-broadband connections having to wait ages for threads to load.

I was using a hack on phpbb that display an 'OOPS' image whenever an IMG was posted that was too big - the OOPS image was clickable to the actual image. The processing was done on the upload not on each 'view' so kept server load to a minuium.

Sorry if I've gone off topic a bit!

Deska 04-21-2005 08:45 AM

is this work with attachment image also?

seg 05-02-2005 02:24 AM

Great hack - does exactly what I need it to do!!! Running it on 3.0.7 - Thanks :D

twizted@dragonm 05-02-2005 02:31 AM

Too bad support for this hack seems nill.....

I am still waiting on a reply about it not altering Signature images...

Jack Jones 05-04-2005 01:31 PM

Takes an EXTREMELY long time to load any pages where this hack comes into effect. vB 3.0.7

BRC2 05-20-2005 11:25 PM

Thanks for a great hack Steve!

I, like everyone else, experience the delay when remote images are resized. I would like to make a suggestion I found incorporated into similar hack for phpBB. The author assigned "ids" to remote images that were resized and stored the resize information in the database. By doing so, images only loaded slow the first time. Afterwards, the images would load at typical speeds because the orginal and new sizes were already stored in the database. If the table became bloated, it could simply be purged without effecting the linked images and the process would continue. I used this on a phpBB site and it made a dramatic impact on load times. I don't know if this can be incorporated into this hack, but if your interested here is a link to the MOD.....Limit Image Width

Brian

theinz 05-21-2005 12:25 PM

Steve,

This hack saved us a lot of trouble thanks so much!! It's working perfectly. I do have a question however. At the end of your install notes you say:

"That's it. Set the max_imagesize at the beginning of the each of the large edits and that will be your max image size."

Where can I set the max_imagesize?

JohnBee 06-22-2005 11:43 AM

I installed this hack it worked nicely but for all our signatures that involved images
they were replaced with a message that said "Image link is broken"

any ideas what might cause this, is there a way to turn this off for signatures?

dansgts 06-22-2005 10:42 PM

can this work with 3.0.7???
i followed the instructions exactly and it dosent do anything.

LambHyjoo 06-24-2005 07:40 AM

Quote:

Originally Posted by BRC2
Thanks for a great hack Steve!

I, like everyone else, experience the delay when remote images are resized. I would like to make a suggestion I found incorporated into similar hack for phpBB. The author assigned "ids" to remote images that were resized and stored the resize information in the database. By doing so, images only loaded slow the first time. Afterwards, the images would load at typical speeds because the orginal and new sizes were already stored in the database. If the table became bloated, it could simply be purged without effecting the linked images and the process would continue. I used this on a phpBB site and it made a dramatic impact on load times. I don't know if this can be incorporated into this hack, but if your interested here is a link to the MOD.....Limit Image Width

Brian

Such an optimization would be great !

mustang_lex 07-03-2005 11:48 PM

This Hack works for 3.0.7 flawlessly. I love it. I don't like the delay, but its better then the other issues I had with 2 other "auto resize" hacks. Yes this is my third.

The problem I had with the other ones. is people started asking why there photos were resized or why is the quality bad (happend when you resize) .

The javascript versions (in earlier hacks) would work but your layout was all screwed up as soon as you entered then got fixed once the photos got resized.

Also some didn't work when you did a REPLY to a thread with over sized picture thus screwing up my layout.

And when I tried to edit the replythread template to add the <body onload> bits it would screw up the smilies!

So needless to say i rather deal with the 2 second delay and wait for a fix then to deal with the other problems.

mustang_lex 07-04-2005 02:35 PM

I heard that "client side" would be faster. Can we mod this hack to load the html page as its resizing the images.

I seen some sites that says "loading images" then the photo appears. Can we implement something like that. just so the page loads first then the photos.

I really love this hack over the others but I do understand people removing because of the lag.

m0nde 07-04-2005 09:25 PM

I run a small forum so this solution is perfect.

Thanks for the great hack! :up:

Steve St.Lauren 07-05-2005 03:36 AM

Quote:

Originally Posted by twizted@dragonm
Works like I expected.. but... a little to well... I dont want it to resize my signature images..... Is there anyway around this or set it to a diff max width for signature images?

Sorry, I've been swamped (new baby on the way, work, life, etc) and haven't had time to jump in here. I'm sure you could modify the signature section but I don't really have the time to look into it. But what I would do is just make your max_imgsize the maximum width that you want to be able to be displayed on a screen and it will resize them all to that. If you have signature images wider than your setting (560 is the default) and you modify it so that the sig images are handled differently all your screen formatting is going to be screwed up anyway. Just change the 560 on the two lines that say "$max_imgsize=560" to whatever you want your maximum image of any kind to be.

Steve St.Lauren 07-05-2005 03:45 AM

Quote:

Originally Posted by Razasharp
Is there anyway to modify this hack so that if the image is too big the system simply does not allow the IMG tag but instead uses the URL tags?

Yes, easily on line 90 & 91 of the hack text file you'll find:
Quote:

$bbtag = '<table><tr><td align="center"><a href="' . $link . '"><img src="'
. $link . '" width="'.$max_imgsize.'" border="0"'.substr($bbtag,$linkclose+1,strlen($bbt ag)-$linkclose+1).'<br>Picture has been resized, click for full size pic</a></td></tr></table>';
change that to:
Quote:

$bbtag = '<table><tr><td align="center"><a href="' . $link . '">'
. $link . '</a></td></tr></table>';
and on line 214 & 215 you'll find:

Quote:

$biglink = '<table><tr><td align="center"><a href="' . $link . '" ><img src="'
. $link . '" width="'.$max_imgsize.'" border="0" alt=""><br>Picture has been resized, click for full size pic</a></td></tr></table>';
change that to:
Quote:

$biglink = '<table><tr><td align="center"><a href="' . $link . '" >'
. $link . '</a></td></tr></table>';
That will just show a link with the html address to the pic.

Steve St.Lauren 07-05-2005 03:46 AM

Quote:

Originally Posted by Deska
is this work with attachment image also?

Image attachments you can put a limit on right in vB - no need for a hack. It's in your control panel under attachments->extensions & sizes

Steve St.Lauren 07-05-2005 03:49 AM

Quote:

Originally Posted by BRC2
Thanks for a great hack Steve!

I, like everyone else, experience the delay when remote images are resized. I would like to make a suggestion I found incorporated into similar hack for phpBB. The author assigned "ids" to remote images that were resized and stored the resize information in the database. By doing so, images only loaded slow the first time. Afterwards, the images would load at typical speeds because the orginal and new sizes were already stored in the database. If the table became bloated, it could simply be purged without effecting the linked images and the process would continue. I used this on a phpBB site and it made a dramatic impact on load times. I don't know if this can be incorporated into this hack, but if your interested here is a link to the MOD.....Limit Image Width

Brian

That's a good idea Brian. Some time when I have a free day or so I'll look into adding it (don't see that happening any time soon though with my wife & I expecting a newborn in 2 months). If anyone wants to tackle this feel free to use the code I generated to this point - just give me credit for it please.

Steve St.Lauren 07-05-2005 03:50 AM

Quote:

Originally Posted by theinz
Steve,

This hack saved us a lot of trouble thanks so much!! It's working perfectly. I do have a question however. At the end of your install notes you say:

"That's it. Set the max_imagesize at the beginning of the each of the large edits and that will be your max image size."

Where can I set the max_imagesize?

Look in the hack text file and you'll see two instances of "$mag_imgsize=560;" - just change the 560 in those two instances to whatever size you want. Before the first one it says " // set max_imgsize to the max size you want pictures to be"

Steve St.Lauren 07-05-2005 03:51 AM

Quote:

Originally Posted by JohnBee
I installed this hack it worked nicely but for all our signatures that involved images
they were replaced with a message that said "Image link is broken"

any ideas what might cause this, is there a way to turn this off for signatures?

Where are those signature images coming from? The server they are on may be restricting your server from opening a file from their server which will cause that error. Give me a link to a page showing a signature doing that and I will take a look.

Steve St.Lauren 07-05-2005 03:52 AM

Quote:

Originally Posted by dansgts
can this work with 3.0.7???
i followed the instructions exactly and it dosent do anything.

You must have missed something - look back over the entire hack file and make sure that you did everything in it. It works fine on 3.0.7

Steve St.Lauren 07-05-2005 03:56 AM

Quote:

Originally Posted by mustang_lex
I heard that "client side" would be faster. Can we mod this hack to load the html page as its resizing the images.

I seen some sites that says "loading images" then the photo appears. Can we implement something like that. just so the page loads first then the photos.

I really love this hack over the others but I do understand people removing because of the lag.

No, there's no way to do that because the server has to have loaded the images so that it knows the size of the image so that it can decide if it needs to be resized or not. If it needs to be resized then it generates the html code to make that resize happen on the client side - if the html was already loaded there wouldn't be any way to modify that. The only other option would be to resize all pictures to the size you specify but that will make images smaller than that size look horrible. If you did that there would be no need to check the image size.

mustang_lex 07-05-2005 04:11 PM

This hack was so promising , and was my favorite. I don't know what happened, but 2 days after this hack was installed, it took longer and longer to load pages with images, so like many others i had to remove it and made another one work 100% (minus the text at the bottom as i liked about this one)

Thanks though. I hope someday this can be revised to be more friendly to larger image forums.

Steve St.Lauren 07-05-2005 04:23 PM

Quote:

Originally Posted by mustang_lex
This hack was so promising , and was my favorite. I don't know what happened, but 2 days after this hack was installed, it took longer and longer to load pages with images, so like many others i had to remove it and made another one work 100% (minus the text at the bottom as i liked about this one)

Thanks though. I hope someday this can be revised to be more friendly to larger image forums.

The more images you have on a post the longer it will take because every image has to be loaded. If there are images on a server that is down or that the server blocks access to it will take even longer because it will have to hit the timeout before continuing. If you have a forum where people put LOTS of images in each thread then it isn't going to work out well for you until I (or someone else) have time to add the optimization recommended by BRC2 above. It'd take me most of a day probably and I just don't have the time right now :( .

mustang_lex 07-06-2005 12:00 PM

Quote:

Originally Posted by Steve St.Lauren
The more images you have on a post the longer it will take because every image has to be loaded. If there are images on a server that is down or that the server blocks access to it will take even longer because it will have to hit the timeout before continuing. If you have a forum where people put LOTS of images in each thread then it isn't going to work out well for you until I (or someone else) have time to add the optimization recommended by BRC2 above. It'd take me most of a day probably and I just don't have the time right now :( .

Don't sweat man, you got a top family priority, I hope to have your experience someday with my wife to be

tommyxv 07-07-2005 05:55 AM

It seems to work great, but on some large images, i get, Image link broken. If i got to edit the post, the images are there, but wont show on the forum. Any ideas?? Maybe it cant handle large images?

Images are 1280 x 960 and were already posted before the hack. I tried to edit the post and redo the links but still no good.

????

Actually, its just images that this one user is posting. Some of smaller images coming from cardomain, they show Image Link Broken too.

Not sure why... hrmmm.

mustang_lex 07-07-2005 12:28 PM

Your server maybe timing out before the images get resized by the server

tommyxv 07-08-2005 02:46 PM

Well, I rehosted the images myself as a test and they came up fine. It was just with this one user. Large or small images, but its fixed now and working great.

Awesome Hack!

Steve St.Lauren 07-08-2005 09:14 PM

Quote:

Originally Posted by tommyxv
Well, I rehosted the images myself as a test and they came up fine. It was just with this one user. Large or small images, but its fixed now and working great.

Awesome Hack!

Some servers have firewalls installed that will not allow other servers to open files for reading from them. If they do that then this hack won't work on that image. It doesn't come up often but it does happen.

Eagle Creek 07-21-2005 04:26 PM

Quote:

Originally Posted by alkatraz
awesome hack!

Is it available for 3.5?

Steve St.Lauren 07-21-2005 05:33 PM

Quote:

Originally Posted by Eagle Creek
Is it available for 3.5?

Not yet. I won't be working with 3.5 until it's a full release and has been out for a month or two.

Eagle Creek 07-21-2005 05:41 PM

Quote:

Originally Posted by Steve St.Lauren
Not yet. I won't be working with 3.5 until it's a full release and has been out for a month or two.

Why not? Can't you test it on the beta version?

Or is that too risky because code changes. But I thought it was easy with the plug-ins.

chris g 08-12-2005 06:18 AM

Quote:

Originally Posted by Eagle Creek
Why not? Can't you test it on the beta version?

Or is that too risky because code changes. But I thought it was easy with the plug-ins.

Hey, I installed this hack and it doesn't seem to do anything. No error messages are generated, the image just shows up full size. I double checked the hack install and everything looks fine. Is there anything that you know of that would cause this code to fail gracefully (as it seems to be doing)? Having this hack isn't a huge issue for me, but it would be nice. Let me know if you need more information to help me out here.

PHP: 4.3.10
vB: 3.0.7

Thanks for writing the code and the GREAT support! Big props!

Steve St.Lauren 08-12-2005 06:51 AM

Quote:

Originally Posted by Eagle Creek
Why not? Can't you test it on the beta version?

Or is that too risky because code changes. But I thought it was easy with the plug-ins.

I could but all my work is production based. I won't be deploying 3.5 anywhere until it's a working stable version and has been out for a few months. Unforetunately, I just don't have enough hours in the day to play around with beta releases. The main site I run gets 2.5 million hits a day and has up to 1400 simultaneous users on the forums and is a subscription site. With that kind of traffic volume I'll let others be the guinea pigs to mark sure it's all working stable before I deploy it. Sorry.

Steve St.Lauren 08-12-2005 06:52 AM

Quote:

Originally Posted by chris g
Hey, I installed this hack and it doesn't seem to do anything. No error messages are generated, the image just shows up full size. I double checked the hack install and everything looks fine. Is there anything that you know of that would cause this code to fail gracefully (as it seems to be doing)? Having this hack isn't a huge issue for me, but it would be nice. Let me know if you need more information to help me out here.

PHP: 4.3.10
vB: 3.0.7

Thanks for writing the code and the GREAT support! Big props!

Hmmm, are you sure the images in question are larger than 560 pixels wide (or whatever you set it to in the hack)? Also that they are linked images and not attached ones? This only works with images linked in with html or vb codes.

chris g 08-12-2005 02:26 PM

I changed the value to 600, will be changing to 800 today when I check the code again. I think I'll have a friend look as well to see if I'm missing anything obvious. Images are inserted via the [ img] [ /img] tags.

In case it helps this: http://shoandgo.com/gallery/albums/album23/100_0491.jpg is one of the test images th at I used. (Warning: Quite large)

I've only tried with vb tags, should I try HTML as another test?

dansgts 08-17-2005 07:03 PM

Quote:

Originally Posted by Steve St.Lauren
You must have missed something - look back over the entire hack file and make sure that you did everything in it. It works fine on 3.0.7

it works for linked immages, but not attached ones, any way to fix that?

dai-kun 08-18-2005 03:14 PM

I installed this a couple of times, but everytime ALL my pictures within posts have the "Image link is broken" error, no matter what size it is. Even signature pics comes up like that. I've read all the replies but nothing really helps. Thanks.


All times are GMT. The time now is 09:14 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
  • Page Generation 0.01499 seconds
  • Memory Usage 1,853KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (23)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete