vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Show Thread Enhancements - The most simple image resizer (https://vborg.vbsupport.ru/showthread.php?t=268087)

Frosty 08-05-2011 10:00 PM

The most simple image resizer
 
1 Attachment(s)
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! :D

BirdOPrey5 08-07-2011 11:24 AM

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.

Frosty 08-08-2011 06:19 AM

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.

zekiturk 08-12-2011 12:01 PM

hoe can we doing " alt="thema title" "

el-q6ri 08-17-2011 08:22 PM

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


https://vborg.vbsupport.ru/external/2011/08/49.png

A.Chakery 12-25-2011 02:24 AM

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 ...

BirdOPrey5 12-25-2011 05:13 PM

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.

A.Chakery 12-25-2011 06:06 PM

thanks for the reply,

got it, so I think I am gonna leave it for now :)

Max Taxable 12-25-2011 06:19 PM

Simple and elegant solution. The BOP5 boost to it really helps too.

A.Chakery 12-25-2011 06:24 PM

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.


All times are GMT. The time now is 10:07 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.01174 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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