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)

DanLai 11-01-2005 04:02 PM

Moreover, the mod has changed the "hand" to "pointer", as kONGO suggested. :devious: Thank you kONGO for this.

Thanks,
DanLai.

kONGO 11-01-2005 05:54 PM

Quote:

Originally Posted by DanLai
The ">" will cause problem when you try to edit the post. :)

Right you are. I knew there was a reason for that function definition, just couldn't figure out why so I changed it. Slap me twice and call me Rhonda.

Glad I could help re: the cursor thing.

evenmonkeys 11-01-2005 10:29 PM

It's sort of working on IE now, and it also limits the size in the signatures. I'm looking for something that is only limited in the post and the signature limits do their own work. >_<;

wrang 11-11-2005 08:27 PM

Great i run VB3.5.1 and it work realy nice
and it work on IE 6.0.290

Great job

My link that it works
http://www.saltvattensguiden.se/foru...ead.php?t=9172
(The hole site is in Swedish and about marinaquarium)

COBRAws 11-12-2005 01:43 AM

Quote:

Originally Posted by xYarub
It's sort of working on IE now, and it also limits the size in the signatures. I'm looking for something that is only limited in the post and the signature limits do their own work. >_<;

how u made it work? Its not working for me under IE, but it works on FireFox. hehehe Uncle Bill doing funny things again :P

ggiersdorf 11-12-2005 09:32 AM

Quote:

Originally Posted by kONGO
I have modified the original HTML a bit, since I didn't like it. I use the title attribute instead of the alt attribute, since HTML standards state that the alt attribute is to be used by screen reading software, whereas the title attribute is usually used to display a 'tooltip' when the mouse is positioned above the element in question.

Also, the hand pointer one sees when the mouse is moved over a link is actually a cursor called pointer, not hand, in the standards.

So, I use this code:
Code:

return '<img onload="if (this.width > 700) {this.width=700; this.title=\'Click to view normal size\';}" onmouseover="if (this.title) {this.style.cursor=\'pointer\';}" onclick="if (this.title) {window.open(\'' . $link . '\');}" src="' . $link . '" border="0" alt="" />';
I modified the handle_bbcode_img_match function in the file includes/class_bbcode.php.

Works in all browsers I've tested it in. If it works in Firefox but not IE, I would say the best bet is to check the IE settings. JavaScript may be fully or partially disabled.

what did you modify in /includes/bbcode I found handle_bbcode_img_match twice but what do I need to modify in those lines!?

ggiersdorf 11-12-2005 09:33 AM

I added your code, but didnt understand what elese you modified or how?

ggiersdorf 11-12-2005 02:02 PM

ok guys I figured out something here. For whatever reason and I hope you can tell me. The First time I go to the site the image will resize in IE. after that it never does it again unless I totally clean my IE settings cache etc. Than it works again 1 time

I tried this from 3 seperate PC's using ie and got the same problem in Firefox it works 100% all the time. Anyone know how to fix that on IE 6+??

mustang_lex 11-12-2005 06:01 PM

How does it effect the top main logo if its dimentions are more then the resize limit. Will it effect the logo like other auto resize scripts.

ggiersdorf 11-14-2005 10:51 PM

anyone supporting this anymore!?

COBRAws 11-15-2005 03:25 PM

This just works with BBCode, your Logo image uses HTML (i believe), thus this hack wont touch your website logo size properties.

-

This is working under firefox like some peepz said. It is working for me under IE only when I wanna see individual post, not on the usual threadview. Weird.

dknelson 11-16-2005 09:14 PM

This problem probably won't affect many here but just a heads up. If you are running vBPortals and running a RSS feed in a block on your portal page, this will prevent the feed from working. Don't know why, I just know that it does.

Don

Flow Fusion 11-16-2005 10:09 PM

Any way to fix this just for avatars that are linked from other sites?

hollyboy 11-18-2005 07:15 PM

Quote:

Originally Posted by Barakat
return '<div style="width: 800px; overflow: auto;"><img src="' . $link . '" border="0" alt="" /></div>';

wow!
I use your code dude!
great

TF|Scorpion 11-19-2005 11:47 AM

I love it, clicks install! :D

TF|Scorpion 11-19-2005 12:04 PM

There is one problem, it does not resize image attachments!

Exernon 11-22-2005 09:42 AM

I thought I works perfectly but then... I when I tried to open the thread again. It didn't resize. But when refreshed, it works again... weird...

VaaKo 11-22-2005 07:41 PM

thx mate, worked like magic after changing 700 to 540

VaaKo 11-22-2005 07:52 PM

after I refreshed the pic got big again.. it didn't work

Exernon 11-23-2005 02:15 AM

Quote:

Originally Posted by Don Corleone
after I refreshed the pic got big again.. it didn't work

Same as my problem...

Anyone?

lefthome 11-27-2005 08:23 PM

Changing the setting from 700 to 540 in IE takes care of the issue with the problem with the picture getting big again...

COBRAws 11-27-2005 09:35 PM

Quote:

Originally Posted by lefthome
Changing the setting from 700 to 540 in IE takes care of the issue with the problem with the picture getting big again...

i got mine to 550 and doesnt work pal

NineToez 11-28-2005 03:11 AM

Worked perfectly!! Just what I wanted and needed! Thank you so much!

Installed. :D

vtx1800 11-28-2005 03:31 AM

I did the same thing, but did this for the change:
Code:

return '<a href="' . $link . '" target="_blank"><img src="' .  $link . '" border="0" width="100" height="100" alt="User Image" /></a>';
However, it still effects the sig images. It works perfectly, with only that one modification, but I want it to not alter sig images.

This one change will work for any browser, no other changes needed.

smdani 11-28-2005 08:27 AM

It works fine for me in firefox, but not in IE like some of you notice, but have some other problem that want to post:

When I show my posts in a non vbpage, with something like this https://vborg.vbsupport.ru/showthrea...3&page=1&pp=15
(It uses the vB_BbCodeParser in the /includes/class_bbcode.php to convert the code from the post)
With this hack of auto resize, I have this error message in those pages:
Error: largerThan is not defined
And, of course the image don?t resizes

?Could anybody help me or improve the hack to make it work in non vb pages like parser do?

I have redden from Kongo that the function largerThan() is not needed so much

?would it solve the problem if I do that he said?
Quote:

Originally Posted by kONGO
It's in the PHP function handle_bbcode_img_match you need to make the change. In that function it is quite clear where the change must be applied (it's a very small function).

Also, as an addition, there is no need to define the largerThan() function. Using
Code:

if (this.width > 700)
works just as well. I've tested this and it works beautifully on Firefox 1.5b2, IE6sp1, Opera 8.

?It brings many other problems like DanLai said?
Quote:

Originally Posted by DanLai
I see the mod working for your site in IE. Maybe the mod is affected by some Javascript settings in IE? What version of IE are you using?

The ">" will cause problem when you try to edit the post. :)

Good to see everyone helping out each other. :rolleyes:

Thanks,
DanLai.

?Could it be solved in other way?


By the way I want to say that this hack was wonderful for my forum, our moderation team was wondering something like this for so long. Thanks a lot for developing it

Sychev_S 12-03-2005 09:02 PM

is there anyway to do the same thing but for attached images?

s1l3NCER 12-14-2005 12:00 AM

Quote:

Originally Posted by Exernon
Same as my problem...

Anyone?

works perfectly install it

Justice 12-16-2005 06:31 AM

cool hack...

does this add any server load to the showthread.php, or is this all done from the user/browser end?

nuxvirg 12-22-2005 11:13 AM

it wasnt work in IE..

Me2Be 12-24-2005 01:32 AM

Another one that works fine on Firefox but not on IE 6.0.28 (changed size to 480)

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 09:25 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.01714 seconds
  • Memory Usage 1,841KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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