Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
The most simple image resizer Details »»
The most simple image resizer
Version: 1.00, by Frosty Frosty is offline
Developer Last Online: Dec 2011 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.8.7 Rating:
Released: 08-05-2011 Last Update: Never Installs: 28
Code Changes  
No support by the author.

If you're sick of all those JS based image resizers, you can use this simple code modification to resize high resolution images everywhere.

Go to: /includes/class_bbcode.php (Line 1987)

Find:
PHP Code:
return '<img src="' .  $link '" border="0" alt="" />'
Replace with:
PHP Code:
return '<img src="' .  $link '" border="0" alt="" style="max-width: 700px" />'
Depending on your post table width, you might change "700px" to some other value, e.g. "800px". It will only resize images that are wider than 700px, which will make them fit to the post table.

There are no other edits required, if user wants to see the full image he'll have to go right click and then view image. Which is in my opinion way better than that fancy "Click to see it in full resolution".

Simple but effective!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
3 благодарности(ей) от:
blind-eddie, LOGECT, ricardoNJ

Comments
  #2  
Old 08-07-2011, 11:24 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very interesting simple edit... :up:

If you changed it to this:

PHP Code:
return '<a href="'$link .'"><img src="' .  $link '" border="0" alt="" style="max-width: 700px" /></a>'
That would make each image a link to the full size image, like here on vbulletin.org.
Reply With Quote
3 благодарности(ей) от:
elzarie, Konstantinos, Max Taxable
  #3  
Old 08-08-2011, 06:19 AM
Frosty Frosty is offline
 
Join Date: Apr 2011
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yup, that's also good. Even though you could add target="_blank" to open in a new window, to make it easier if there are many images in the thread.
Reply With Quote
  #4  
Old 08-12-2011, 12:01 PM
zekiturk zekiturk is offline
 
Join Date: Mar 2007
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hoe can we doing " alt="thema title" "
Reply With Quote
  #5  
Old 08-17-2011, 08:22 PM
el-q6ri el-q6ri is offline
 
Join Date: Jan 2008
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi thanks for the mode

I use it like this

Code:
return '<a target="_blank" href="'. $link .'"><img src="' .  $link . '" border="0" alt="" style="max-width: 700px" /></a>';
but the problem

if the image is has a link for a post or any url it will not lead to the link I want to for example


Reply With Quote
  #6  
Old 12-25-2011, 02:24 AM
A.Chakery's Avatar
A.Chakery A.Chakery is offline
 
Join Date: Jul 2007
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ist here any way to set an if for the image size ?

I mean if the image size was bigger than 600px it makes it like this
HTML Code:
return '<a href="'. $link .'"><img src="' .  $link . '" border="0" alt="" style="max-width: 600px" /></a>';
but if it was smaller than 600px it makes it like this one :

HTML Code:
return '<img src="' .  $link . '" border="0" alt="" style="max-width: 600px" />';
??

any help is really appreciated ...
Reply With Quote
  #7  
Old 12-25-2011, 05:13 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes and no...

You could test for it but it would require custom php code and you would need to download a copy of every image, at least temporarily, to you server so you could read the size- this would be a relatively slow process but possible, yes.
Reply With Quote
  #8  
Old 12-25-2011, 06:06 PM
A.Chakery's Avatar
A.Chakery A.Chakery is offline
 
Join Date: Jul 2007
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for the reply,

got it, so I think I am gonna leave it for now
Reply With Quote
  #9  
Old 12-25-2011, 06:19 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Simple and elegant solution. The BOP5 boost to it really helps too.
Reply With Quote
  #10  
Old 12-25-2011, 06:24 PM
A.Chakery's Avatar
A.Chakery A.Chakery is offline
 
Join Date: Jul 2007
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

unfortunately if I add <a href="'. $link .'"> before the image links in class_bbcode.php, all of images will be linked to themselves so they won't accept URLs anymore.Its a big problem for my website.
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 06:11 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06195 seconds
  • Memory Usage 2,321KB
  • Queries Executed 24 (?)
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
  • (1)bbcode_code
  • (2)bbcode_html
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (6)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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