Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Wide image automatic resize for html and vB tags in posts - fixes template problems Details »»
Wide image automatic resize for html and vB tags in posts - fixes template problems
Version: 1.00, by Steve St.Lauren Steve St.Lauren is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: 3.0.8 Rating:
Released: 07-28-2004 Last Update: 09-09-2004 Installs: 111
 
No support by the author.

Having trouble with large images in [img] or <img src> tags in your posts causing your templates to go too wide causing a horizontal scroll bar for all posts? I have many users that attach large images to their posts either through vB img or html img src tags. In vB2 it wasn't that much of an issue because it only caused their post to go wide causing a horizontal scroll bar. In vB3 it causes all the posts on that thread to go to that width.

This hack uses the img src width="xx" tag to resize the picture to whatever max size you wish. It also adds a link to the full size image in it's original location and retains any extra formatting the user puts in the tag. In addition it checks to see if the picture actually exists and if not show "Image link is broken" where the picture would have been. Please click install if you install it and please give feedback so I can go full release with it if it's bug free.

Updated on 07/30/2004 - R0.9
Updated on 08/06/2004 - R1.0 - Identical to R.9, no need to upgrade just changing to full release from beta
Updated on 08/10/2004 - R1.1 - Added max_imgsize to the 2nd section of code (and removed global max_imgsize line from both), some users had problems with the code grabbing the max_imgsize from the first section - this fixes that.
Updated on 09/09/2004 - R1.2 - fixed problem with duplicating the resize notice when using wysiwyg editor

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #132  
Old 06-22-2005, 11:43 AM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #133  
Old 06-22-2005, 10:42 PM
dansgts dansgts is offline
 
Join Date: Jun 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can this work with 3.0.7???
i followed the instructions exactly and it dosent do anything.
Reply With Quote
  #134  
Old 06-24-2005, 07:40 AM
LambHyjoo LambHyjoo is offline
 
Join Date: Apr 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 !
Reply With Quote
  #135  
Old 07-03-2005, 11:48 PM
mustang_lex mustang_lex is offline
 
Join Date: May 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #136  
Old 07-04-2005, 02:35 PM
mustang_lex mustang_lex is offline
 
Join Date: May 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #137  
Old 07-04-2005, 09:25 PM
m0nde's Avatar
m0nde m0nde is offline
 
Join Date: Mar 2005
Location: Toronto, ON Canada
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I run a small forum so this solution is perfect.

Thanks for the great hack! :up:
Reply With Quote
  #138  
Old 07-05-2005, 03:36 AM
Steve St.Lauren Steve St.Lauren is offline
 
Join Date: May 2002
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #139  
Old 07-05-2005, 03:45 AM
Steve St.Lauren Steve St.Lauren is offline
 
Join Date: May 2002
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #140  
Old 07-05-2005, 03:46 AM
Steve St.Lauren Steve St.Lauren is offline
 
Join Date: May 2002
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #141  
Old 07-05-2005, 03:49 AM
Steve St.Lauren Steve St.Lauren is offline
 
Join Date: May 2002
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:47 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
  • Page Generation 0.07283 seconds
  • Memory Usage 2,317KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete