Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Auto resize large image Details »»
Auto resize large image
Version: 1.00, by DanLai DanLai is offline
Developer Last Online: May 2008 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 10-24-2005 Last Update: Never Installs: 145
 
No support by the author.

In fact this is a work around for the auto resize feature to work with the WYSIWYG editor.

Step1. In includes/class_bbcode.php

Find (in line around 18xx):
Code:
return '<img src="' .  $link . '" border="0" alt="" />';
Replace with:
Code:
return '<img src="' . $link . '" onload="if(largerThan(this.width,700)) {this.width=700;this.alt=\'Click here to see a large version\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';
Step2. Modify the common template of your template set

Add this to the headinclude section:
Code:
<script type="text/javascript">
function largerThan(a,b)
{
return a>b;
}
</script>
Demo:
http://talkmusic.org/showthread.php?t=3165

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 10-31-2005, 01:42 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, what I don't like about this so far is that it's never working on IE for me, 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. >_<;
Reply With Quote
  #33  
Old 11-01-2005, 12:20 AM
ferrarislave ferrarislave is offline
 
Join Date: Jul 2005
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xYarub
Well, what I don't like about this so far is that it's never working on IE for me, 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. >_<;
Mod is not working for me in IE either, only in FireFox, what gives? Can someone help!!?
Reply With Quote
  #34  
Old 11-01-2005, 12:52 AM
Vtec44 Vtec44 is offline
 
Join Date: Jan 2005
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What version of IE are you guys using? I'm using IE6 and it seems to be working fine.
Reply With Quote
  #35  
Old 11-01-2005, 11:32 AM
ggiersdorf ggiersdorf is offline
 
Join Date: Aug 2005
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mabey it has something to do with where you place it? Vtec please post a few lines above and below where you posted the text and anything else that might help us. I cannot get it to work either on my site Firefox fine, but ie 6+ does not.
Reply With Quote
  #36  
Old 11-01-2005, 01:17 PM
DanLai's Avatar
DanLai DanLai is offline
 
Join Date: Sep 2005
Location: Hong Kong
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Some guide questions for users in trouble (with IE), please answer them so I could have the clue to solve your problem.

1. Can you see the demo working on IE? (Can -> 2, Cannot->3)
2. Please let me see your forum page where this mod is applied.
3. If you cannot see it working, what version of IE are you using?

Thanks!
DanLai.
Reply With Quote
  #37  
Old 11-01-2005, 01:22 PM
ggiersdorf ggiersdorf is offline
 
Join Date: Aug 2005
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Example:

http://www.sonyverse.com/forum/showthread.php?t=11

here is my code

return '<img src="' . $link . '" onload="if(largerThan(this.width,700)) {this.width=700;this.alt=\'Click here to see a large version\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';


in Firefox it resizes fine in IE this is what I get..
Reply With Quote
  #38  
Old 11-01-2005, 01:24 PM
kONGO's Avatar
kONGO kONGO is offline
 
Join Date: Feb 2004
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ggiersdorf
Mabey it has something to do with where you place it? Vtec please post a few lines above and below where you posted the text and anything else that might help us. I cannot get it to work either on my site Firefox fine, but ie 6+ does not.
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.
Reply With Quote
  #39  
Old 11-01-2005, 01:55 PM
ggiersdorf ggiersdorf is offline
 
Join Date: Aug 2005
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kongo IM new sorry can you please explain where and what needs modified for us so we can enjoy the benifits of this mod?

Thanks in advnace..

Look at my code above thats in the bbcode php file
Reply With Quote
  #40  
Old 11-01-2005, 02:12 PM
kONGO's Avatar
kONGO kONGO is offline
 
Join Date: Feb 2004
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #41  
Old 11-01-2005, 04:01 PM
DanLai's Avatar
DanLai DanLai is offline
 
Join Date: Sep 2005
Location: Hong Kong
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ggiersdorf
Example:

http://www.sonyverse.com/forum/showthread.php?t=11

here is my code

return '<img src="' . $link . '" onload="if(largerThan(this.width,700)) {this.width=700;this.alt=\'Click here to see a large version\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';


in Firefox it resizes fine in IE this is what I get..
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?

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.
The ">" will cause problem when you try to edit the post.

Good to see everyone helping out each other.

Thanks,
DanLai.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07705 seconds
  • Memory Usage 2,318KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete