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)

SiMateoAko 06-12-2006 04:35 AM

Quote:

Originally Posted by jags2ooo
SiMateoAko AWESOME IT WORKS PERFECT!!!!!!!!! i just opened up a new forums 1 hour ago and of course some dude had to post a image that was so FREaking big and fked up the boards so i cam ehere ran a search and bam your fix owns :) THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11

I recommend Simateoako's version of this mod his is posted at post number #106 its nice and short only 1 line :D

There is a small problem with this and I had to remove it. It seems that when someone quotes a message with images in it they do not always parse correctly for the text editor.

I'm going to have to look into it a bit more.

SiMateoAko 06-14-2006 03:01 PM

Quote:

Originally Posted by SiMateoAko
There is a small problem with this and I had to remove it. It seems that when someone quotes a message with images in it they do not always parse correctly for the text editor.

I'm going to have to look into it a bit more.

I just replaced the code as follows and it appears to be working correctly. i'll give an explanation below for people to understand.

replace this line in your class_bbcode.php file:
Code:

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

Code:

return '<img style="max-width:800px;" style= "width: expression(this.width > 800 ? 800: true);" src="' .  $link . '" border="0" alt="" >';
A style attribute in firefox is "max-width," and it does everything we want it to do. "max-height" is also a style attribute.

IE, in it's infinite wisdom, decided to not include this style attribute. As a result we have to use a java expression to resize the image.

In the past there were issues if I quoted a post with an image in it, but it appears to be better now that the two style expressions are seperate.

With any luck IE will add the "max-width" and "max-height" expression for future versions of IE.

nymyth 06-14-2006 06:45 PM

^^Works great mate...thanks...

Peace

tormento 06-19-2006 09:01 PM

work great on mine

forums

tormento 06-19-2006 09:03 PM

ot
for the attach,someone has an idea for me?

epicbear 06-22-2006 04:56 PM

I'm not sure if something is seeing is related to this hack or not but in either case, I could use a little help.

I'm seeing some weird behavior, ONLY in IE. The image in question is being resized properly but the page is still going wide...even though the image isn't even wide enough to caus that to begin with!

Here's what I've discovered. If I paste the page source into Dreamweaver and save it and preview it in IE, the page is still strtched wide, inspite of all the missing css and images...so I start debugging and find the fulcrum upon which this behavior tilts.

There is an image:

http://i68.photobucket.com/albums/i1...ccident015.jpg

if I edit the URL so that the host is www and not i68, the horizontal scrolling issue disappears.

Can anyone see any reason for this either due to this hack or IE itself?

NeutralizeR 06-30-2006 05:31 PM

none of the codes work for vBulletin 3.6 Beta 3. (at least if you edit the message)

PHP Code:

function handle_bbcode_img_match($link)
    {
        
$link $this->strip_smilies(str_replace('\\"''"'$link));

        
// remove double spaces -- fixes issues with wordwrap
        
$link str_replace('  '''$link);

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

Anyone has vb 3.6 compatible version of the image resizing code?

NeutralizeR 07-02-2006 01:42 PM

Some invalid html image code shows up if you edit the message...

bhxtyrant 07-13-2006 09:08 PM

Quote:

Originally Posted by SiMateoAko
I just replaced the code as follows and it appears to be working correctly. i'll give an explanation below for people to understand.

replace this line in your class_bbcode.php file:
Code:

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

Code:

return '<img style="max-width:800px;" style= "width: expression(this.width > 800 ? 800: true);" src="' .  $link . '" border="0" alt="" >';
A style attribute in firefox is "max-width," and it does everything we want it to do. "max-height" is also a style attribute.

IE, in it's infinite wisdom, decided to not include this style attribute. As a result we have to use a java expression to resize the image.

In the past there were issues if I quoted a post with an image in it, but it appears to be better now that the two style expressions are seperate.

With any luck IE will add the "max-width" and "max-height" expression for future versions of IE.

I added this to my forum and it works great,I was wondering if i might make a request.Can someone add a code to this current code that gives the option to make the resized image clickable to view the full image in a new window?

I tryed this hack before https://vborg.vbsupport.ru/showthrea...t=99286&page=7 which does have that option but i had loads of trouble getting it to work.Sometimes it would work others it would not especially in IE6.Thanks also note im using VB 3.5.4 if thats of any relivence.

A17roolz 07-15-2006 06:29 PM

Quote:

Originally Posted by SiMateoAko
I just replaced the code as follows and it appears to be working correctly. i'll give an explanation below for people to understand.

replace this line in your class_bbcode.php file:
Code:

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

Code:

return '<img style="max-width:800px;" style= "width: expression(this.width > 800 ? 800: true);" src="' .  $link . '" border="0" alt="" >';
A style attribute in firefox is "max-width," and it does everything we want it to do. "max-height" is also a style attribute.

IE, in it's infinite wisdom, decided to not include this style attribute. As a result we have to use a java expression to resize the image.

In the past there were issues if I quoted a post with an image in it, but it appears to be better now that the two style expressions are seperate.

With any luck IE will add the "max-width" and "max-height" expression for future versions of IE.

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?


All times are GMT. The time now is 06:26 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.01228 seconds
  • Memory Usage 1,765KB
  • 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
  • (6)bbcode_code_printable
  • (3)bbcode_php_printable
  • (4)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