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)

NeutralizeR 07-15-2006 11:55 PM

Anyone using this code with vb 3.6 ?

bhxtyrant 07-16-2006 01:09 AM

Quote:

Originally Posted by A17roolz
Awesome code! Although I have a problem...

See, the reason I needed an image resizer was mostly for my news fetch (click here to see what I mean). I'm perfectly fine with everything, except the bbs main body is actually larger than the news fetch body, and it poses a problem with signatures. I'm ok with main body images being resized, but is there a way to keep signatures unaffected by image resizes? Or, even better, make it so that the signature images have a different resize limit?

EDIT: Nevermind, I found out how to make the image stay at it's normal size unless it stretches the page. Just replace this:

PHP Code:

return '<img style="max-width:800px;" style= "width: expression(this.width > 800 ? 800: true);" src="' .  $link '" border="0" alt="" >'

With this:

PHP Code:

return '<img style="max-width:100%;" style= "width: expression(this.width > 100% ? 100%: true);" src="' .  $link '" border="0" alt="" >'

EDIT 2: Hmmm, this code only seems to work in Firefox (dunno about Opera). Anyone have anyideas as to how I can get it to work in IE?

I had the first code and it worked in both IE,FF,opera and netscape.

A17roolz 07-16-2006 01:13 AM

Quote:

Originally Posted by bhxtyrant
I had the first code and it worked in both IE,FF,opera and netscape.

Oh yeah, that code worked flawlessly, but what I'm trying to do is to have the image go to the maximum width it can without stretching if it causes the table to stretch. Putting 100% seems to make that work in FF, but not IE. To see what I mean, look at the below page in both IE and FF:

http://www.vgreality.com/testphp.php

bhxtyrant 07-16-2006 04:37 AM

Yeah i know what you mean,I have been trying to do the same with the script found on a previous page but it seems the script will not accept sizes in % rather then pixels.I liked that script over the one you are looking at mainly due to the fact that it has the ability for a user to click the resized image to display the original image in a new window.It seems vB doesnt allow to many things in % in it's code not even the sizes for the text editor which would be really handy.

A17roolz 07-16-2006 09:35 AM

Quote:

Originally Posted by bhxtyrant
Yeah i know what you mean,I have been trying to do the same with the script found on a previous page but it seems the script will not accept sizes in % rather then pixels.I liked that script over the one you are looking at mainly due to the fact that it has the ability for a user to click the resized image to display the original image in a new window.It seems vB doesnt allow to many things in % in it's code not even the sizes for the text editor which would be really handy.

vB is not the problem here, what is the problem is IE, because that's what can't detect the coding. I'm not looking for a code with a clickable image if it gets too big because then you can't use the [url] BBCode with it, and that's really annoying. My philosophy is, if it's the width of the table, it's big enough for you to see anyways.

TitanJeff 07-17-2006 01:00 AM

I love the idea of this but am confused as to which of the codes I should be using.

I am running 3.5.1 and want to make sure these image sizes stay at 450 pixels wide. Thanks for any help.

dodjer42 07-27-2006 04:22 AM

Quote:

Originally Posted by SiMateoAko
Lots of info here. If you're like me and don't want to add 30 lines of code to your img tags, do what I did.

replace this:

Code:

return '<img src="' .  $link . '" border="0" alt="" />';
with this:

Code:

return '<img style="max-width:800px; width: expression(this.width > 800 ? 800: true);" src="' .  $link . '" border="0" alt="" />';
The code you want to replace is found in the function handle_bbcode_img_match() in class_bbcode.php. For me it was on line 1831.

This is fast and will work with either firefox or IE. It may even work with Opera, but I don't know.


I tried this and images no longer appear. Damn... I love the idea of only one line.

SiMateoAko 08-14-2006 10:07 PM

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.

encryption 08-29-2006 11:26 AM

^^ That wont work because it even resized large image headers on sites that use forum width sized banners - its resizing banners on my site

Ranger187 08-30-2006 12:55 AM

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.

Where do we add this? What file, where? Can you elaborate?

Thanks.


All times are GMT. The time now is 02:46 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.04139 seconds
  • Memory Usage 1,752KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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