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
  #62  
Old 11-27-2005, 08:23 PM
lefthome's Avatar
lefthome lefthome is offline
 
Join Date: Feb 2005
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Changing the setting from 700 to 540 in IE takes care of the issue with the problem with the picture getting big again...
Reply With Quote
  #63  
Old 11-27-2005, 09:35 PM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #64  
Old 11-28-2005, 03:11 AM
NineToez NineToez is offline
 
Join Date: Nov 2005
Location: Los Angeles, CA
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Installed.
Reply With Quote
  #65  
Old 11-28-2005, 03:31 AM
vtx1800 vtx1800 is offline
 
Join Date: Nov 2005
Location: California
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #66  
Old 11-28-2005, 08:27 AM
smdani smdani is offline
 
Join Date: Nov 2004
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

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
Reply With Quote
  #67  
Old 12-03-2005, 09:02 PM
Sychev_S Sychev_S is offline
 
Join Date: Oct 2005
Location: Toronto
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there anyway to do the same thing but for attached images?
Reply With Quote
  #68  
Old 12-14-2005, 12:00 AM
s1l3NCER's Avatar
s1l3NCER s1l3NCER is offline
 
Join Date: Aug 2004
Location: California
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Exernon
Same as my problem...

Anyone?
works perfectly install it
Reply With Quote
  #69  
Old 12-16-2005, 06:31 AM
Justice's Avatar
Justice Justice is offline
 
Join Date: Oct 2001
Location: New Orleans
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cool hack...

does this add any server load to the showthread.php, or is this all done from the user/browser end?
Reply With Quote
  #70  
Old 12-22-2005, 11:13 AM
nuxvirg's Avatar
nuxvirg nuxvirg is offline
 
Join Date: Dec 2005
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it wasnt work in IE..
Reply With Quote
  #71  
Old 12-24-2005, 01:32 AM
Me2Be's Avatar
Me2Be Me2Be is offline
 
Join Date: Oct 2001
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another one that works fine on Firefox but not on IE 6.0.28 (changed size to 480)
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 06:40 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.05018 seconds
  • Memory Usage 2,306KB
  • 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
  • (5)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