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
  #2  
Old 10-25-2005, 05:28 PM
swantonio's Avatar
swantonio swantonio is offline
 
Join Date: Aug 2004
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

good grazie ... .-)
Reply With Quote
  #3  
Old 10-25-2005, 05:41 PM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Simple effective, I like

congratulation

"Click Install"
Reply With Quote
  #4  
Old 10-25-2005, 06:30 PM
nokturno nokturno is offline
 
Join Date: Sep 2005
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

congratulation
Reply With Quote
  #5  
Old 10-25-2005, 07:23 PM
Pramodinfo Pramodinfo is offline
 
Join Date: Sep 2005
Location: India
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*Clicks Install* Thanks
Reply With Quote
  #6  
Old 10-25-2005, 08:47 PM
CBE CBE is offline
 
Join Date: Jun 2005
Location: U.A.E.
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the best image resizer i have seen,,
thank u very much
Reply With Quote
  #7  
Old 10-25-2005, 09:25 PM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's the way for adding a text that says something like "Click on the image to see orginial size"?

ORIGINAL MOD:
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" />';

WITH TEXT BELOW:
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" /><br /><p>Click on the image to see original size<p />';
Someone please tell me if this is ok.
Reply With Quote
  #8  
Old 10-25-2005, 11:48 PM
Barakat's Avatar
Barakat Barakat is offline
 
Join Date: Nov 2004
Location: Jerusalem
Posts: 571
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

iam useing this and its usefull also .
in the same file and the same code just find this code :-

PHP Code:
return '<img src="' .  $link '" border="0" alt="" />'
replace it with :-

PHP Code:
return '<div style="width: 800px; overflow: auto;"><img src="' .  $link '" border="0" alt="" /></div>'
it will give u a frame on large pictures and will save ur style as it is .
just choose the width as u want the picture to be shown and thats all ...

any way i will try ur code also
Reply With Quote
  #9  
Old 10-26-2005, 07:57 AM
Xplorer4x4 Xplorer4x4 is offline
 
Join Date: Apr 2005
Posts: 938
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This belongs in the code modification forum as it it edits one of the orignal vB scripts.
Reply With Quote
  #10  
Old 10-26-2005, 08:24 AM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been looking for this. Thanks!
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:16 AM.


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.04412 seconds
  • Memory Usage 2,300KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_php
  • (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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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