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 large image (https://vborg.vbsupport.ru/showthread.php?t=99286)

ggiersdorf 12-24-2005 11:36 AM

I had problems like all the rest of you, but I got it working with some modifications on IE-(Maxathon), IE, Firefox, and Opera..

this is what I came up with, along with the code in the original post in headincludes section.

class_bbcode.php


PHP 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 */ 

Only thing I need help with now is making that image clikcable to open in full screen when clicked. Can anyone modify this, and make this the defacto Image resize code!??

Marris 12-25-2005 09:47 PM

Quote:

Originally Posted by ggiersdorf
I had problems like all the rest of you, but I got it working with some modifications on IE-(Maxathon), IE, Firefox, and Opera..

this is what I came up with, along with the code in the original post in headincludes section.
...
Only thing I need help with now is making that image clikcable to open in full screen when clicked. Can anyone modify this, and make this the defacto Image resize code!??

Thanks ggiersdorf, your IE code is a lot more consistent for me than the javascript. Your IE conditional along with DanLai's original code for other browsers seems to work best for me. Firefox was fine with either, but the DanLai's code seemed to work better in Opera than the max-width line.

I also hope someone can help with adding a "click to resize" link to ggiersdorf's IE code.

ggiersdorf 12-27-2005 01:42 PM

Thanks Marris, I love how it is functioning and Im working on the Clickable code also, though Im not very refined on this stuff. Please anyone with coding experience please help us out and finish off the code above for clickable fullsize images..

Glad I could help..

coloradok5 12-31-2005 07:10 PM

Anyone have ideas to make this clickable?

LittleBoy1 01-05-2006 08:59 PM

ThanckYou! The Best Hack for Images ultra Small!

SeeYa!

Marris 01-07-2006 08:08 PM

Well, I've got a semi-working popup in IE with ggiersdorf's code. This is the most consistent for me, but still not perfect:

Code:

$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" onload="if(this.width >= 400) {this.alt=\'Click here to see the orignal image\';}" style="width: expression(this.width > 400 ? 400 : true);" onmouseover="if(this.width >= 400) {this.style.cursor=\'pointer\';}" onclick="if(this.width >= 400) window.open(\'' . $link . '\',\'Image\',\'toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes\');"/>';
} else {
    return '<img src="' . $link . '" onload="if(largerThan(this.width,400)) {this.width=400;this.alt=\'Click here to see the orignal image\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';
}

Replace all occurances of 400 with your desired width value.

In the IE code, instead of if(this.width >= 400), you are welcome to try combinations of these other if statements:

if(largerThan(this.width,400))
if(this.width > 400)
if(this.alt)

But neither of those worked consistently for me. I tried many different combinations and the code block above is what works best for me across IE, Firefox and Opera.

I welcome improvements.

Bieddos 01-10-2006 06:02 PM

Very good mod!!!

JaeTea 01-20-2006 01:09 AM

Quote:

Originally Posted by Marris
Well, I've got a semi-working popup in IE with ggiersdorf's code. This is the most consistent for me, but still not perfect:


Haha..holy crap it's actually working for me in Firefox AND IE! :surprised:

crash resistant 01-26-2006 02:58 AM

omg. best. hack. ever.

( the latest modification of it on this page )

TY Marris!!!!!!!!!!!!!!!!!!!!!!

evenmonkeys 01-26-2006 04:51 AM

Quote:

Originally Posted by Marris
Well, I've got a semi-working popup in IE with ggiersdorf's code. This is the most consistent for me, but still not perfect:

Code:

$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" onload="if(this.width >= 400) {this.alt=\'Click here to see the orignal image\';}" style="width: expression(this.width > 400 ? 400 : true);" onmouseover="if(this.width >= 400) {this.style.cursor=\'pointer\';}" onclick="if(this.width >= 400) window.open(\'' . $link . '\',\'Image\',\'toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes\');"/>';
} else {
return '<img src="' . $link . '" onload="if(largerThan(this.width,400)) {this.width=400;this.alt=\'Click here to see the orignal image\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';
}

Replace all occurances of 400 with your desired width value.

In the IE code, instead of if(this.width >= 400), you are welcome to try combinations of these other if statements:

if(largerThan(this.width,400))
if(this.width > 400)
if(this.alt)

But neither of those worked consistently for me. I tried many different combinations and the code block above is what works best for me across IE, Firefox and Opera.

I welcome improvements.

Oh my god... it finally works. You are truly me hero.


All times are GMT. The time now is 07:46 PM.

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.03884 seconds
  • Memory Usage 1,759KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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