vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Auto Resize Your Images 3.52 compliant (https://vborg.vbsupport.ru/showthread.php?t=103915)

Aaron RV 09-06-2006 03:17 AM

ok for vb 3.6?

Traxdata 09-07-2006 03:52 PM

Yes. Works fine with vb 3.6.

GNDI 09-20-2006 12:10 PM

Quote:

Originally Posted by SiMateoAko
NEW METHOD:

I can't believe I didn't think of this before.

Some of you may have editted your class_bbcode.php ( as per my instructions before ) to have it work correctly. I'd now recommend you don't do that and just add a few lines to your CSS file instead.

Add the following to your CSS:

Code:

IMG {
max-width: 700px;
width: expression(this.width > 700 ? 700: true);
}

Obviously change your values appropriately.

The benefits of doing it this way are hopefully obvious. No code changes are required, so upgrading won't be an issue.

IE is the real problem here b/c they are not totally CSS2 compliant. I believe it's been fixed with IE7, but the second statement (width: expression..) is just for people using old browsers.

by doing it this way you loose the link to the ral fullsize image :(

NeutralizeR 09-26-2006 10:15 PM

I've found an alternative solution (I'm running a vBulletin 3.6.1 board)

Open your /forum/includes/class_bbcode.php file:

On line 1879, replace:
PHP Code:

return '<img src="' .  $link '" border="0" alt="" />'

with:
PHP Code:

return '<img class="resize" src="' .  $link '" border="0" alt="" />'

Open your Style Manager > Main CSS > Additional CSS Definitions and add this code at the bottom:
HTML Code:

.resize {max-width: 728px; width: expression(this.width > 728 ? 728: true);}
Save.

Tested both in IE7 RC1 & Firefox 1.5.0.7

Resized image will keep it's link if it has any.

Demo:
http://www.msxlabs.org/forum/dogadan...tml#post224010

Actual image width is 1024 pixels (resized to 728px) and the thumbnail keeps the link.

PersianImmortal 09-29-2006 03:36 AM

Very useful, neutralizer thanks - this is by far the easiest way to do this.

I personally set both max width and max height in the CSS definition, as extremely 'tall' images can be annoying too, i.e. I use this CSS code:

HTML Code:

.resize
{
max-width: 500px;
max-height: 400px;
width: expression(this.width > 500 ? 500: true);
height: expression(this.height > 400 ? 400: true);
}

This is on a VB 3.6.0 forum. The one thing I would like though is a way of making this resized image clickable so you can view the larger image with a click - anyone know how to easily add this function via CSS (even if it has to call a function in headinclude)?

/EDIT: Nevermind, I wound up modifying and using the code here and it works a treat for me :)

smsmasters 10-07-2006 09:01 PM

Quote:

Originally Posted by NeutralizeR
I've found an alternative solution (I'm running a vBulletin 3.6.1 board)

Open your /forum/includes/class_bbcode.php file:

On line 1879, replace:
PHP Code:

return '<img src="' $link '" border="0" alt="" />'

with:
PHP Code:

return '<img class="resize" src="' $link '" border="0" alt="" />'

Open your Style Manager > Main CSS > Additional CSS Definitions and add this code at the bottom:
HTML Code:

.resize {max-width: 728px; width: expression(this.width > 728 ? 728: true);}
Save.

Tested both in IE7 RC1 & Firefox 1.5.0.7

Resized image will keep it's link if it has any.

Demo:
http://www.msxlabs.org/forum/dogadan...tml#post224010

Actual image width is 1024 pixels (resized to 728px) and the thumbnail keeps the link.

Excellent! :)

manutdvn 10-08-2006 04:25 PM

Quote:

Originally Posted by BluPhoenix
change:
Code:

/* Start Image RESIZE */ 

 $navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : ''; 
if (stristr($navigator_user_agent, "msie")) { 
    return '<img src="' .  $link . '" border="0" alt="" style="width: expression(this.width > 640 ? 480 : true);" />'; 
} else { 
    return '<img src="' .  $link . '" border="0" alt="" style="max-width: 730px;" />'; 
}   

/* End Image RESIZE */

to:

Code:

/* Start Image RESIZE */ 

 $navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : ''; 
if (stristr($navigator_user_agent, "msie")) { 
    return '<a href="' .  $link . '" target="_blank"><img src="' .  $link . '" border="0" alt="" style="width: expression(this.width > 640 ? 480 : true);" /></a>'; 
} else { 
    return '<a href="' .  $link . '" target="_blank"><img src="' .  $link . '" border="0" alt="" style="max-width: 730px;" /></a>'; 
}   

/* End Image RESIZE */

That'll make it clickable.. but what does the javascript addition do? from what I see your just using css no need for the javascript?

Thank you. It works great with IE 7.0 and Firefox. Click install. I am current with VBB 3.5.4

RFViet 10-10-2006 04:52 PM

I'm confused !! which code is used for vB3.5.5 ??

smsmasters 10-10-2006 08:58 PM

This works great but how do I stop the images in signatures from being resized too?

Thanks

Quote:

Originally Posted by NeutralizeR
I've found an alternative solution (I'm running a vBulletin 3.6.1 board)

Open your /forum/includes/class_bbcode.php file:

On line 1879, replace:
PHP Code:

return '<img src="' $link '" border="0" alt="" />'

with:
PHP Code:

return '<img class="resize" src="' $link '" border="0" alt="" />'

Open your Style Manager > Main CSS > Additional CSS Definitions and add this code at the bottom:
HTML Code:

.resize {max-width: 728px; width: expression(this.width > 728 ? 728: true);}
Save.

Tested both in IE7 RC1 & Firefox 1.5.0.7

Resized image will keep it's link if it has any.

Demo:
http://www.msxlabs.org/forum/dogadan...tml#post224010

Actual image width is 1024 pixels (resized to 728px) and the thumbnail keeps the link.


Aaron RV 11-20-2006 07:35 AM

in vb 3.6.3 not work.
when I can change the code?

thank's.


All times are GMT. The time now is 02:50 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.01309 seconds
  • Memory Usage 1,763KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_html_printable
  • (6)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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