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

Reply
 
Thread Tools
Auto Resize large images in an IMG tag Details »»
Auto Resize large images in an IMG tag
Version: 1.00, by mr.gamesbay mr.gamesbay is offline
Developer Last Online: Dec 2009 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.6.4 Rating:
Released: 08-31-2006 Last Update: Never Installs: 272
Template Edits
Code Changes Additional Files  
No support by the author.

First, sorry about my bad english

With this small hack, all large images in an IMG Tag will be resized after the site has loaded. With a click on the resized imge, it will open in an new window with the original size. Works in Firefox, Opera, IE and i think in all other browser.
Here is a Demo: Link

Work with vB 3.6.0 - 3.6.4

INSTALLATION:

--------------------------------

- Copy the file resizevbimg.js in the dir clientscript.

--------------------------------

Open the file includes/class_bbcode.php
Search the line(~line 1887 ):

Code:
return '<img src="' .  $link . '" border="0" alt="" />';
and replace with:
Code:
return '<img src="' .  $link . '" border="0" alt="" id="vBCodeIMG" />';
Save and upload.

--------------------------------

Styles & Templates > Search the SHOWTHREAD Template
Seach:
Code:
<body onload="$onload">
Replace with:
Code:
<body onload="$onload;vbImageResize()">
Save the template.

--------------------------------

Styles & Templates > Search the NEWREPLY Template
Search:
Code:
 <body$onload>
Replace with:
Code:
<body onload="$onload;vbImageResize()">
Save the template.

--------------------------------

- Styles & Templates > Style Manager > Common Templates > headinclude
Search:
Code:
<!-- / CSS Stylesheet -->
After, add:
Code:
<script type="text/javascript" src="clientscript/resizevbimg.js"></script>
Save the template.

--------------------------------

Styles & Templates > Style Manager > Main CSS > Additional CSS Definitions

After, add:
Code:
.vbimgcodelimit {
        cursor: pointer;
        border: dotted 1px black;
}
Save.
--------------------------------

Done

Show Your Support

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

Comments
  #22  
Old 09-03-2006, 05:24 PM
twitch's Avatar
twitch twitch is offline
 
Join Date: Apr 2005
Posts: 260
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice, thanks
Reply With Quote
  #23  
Old 09-03-2006, 07:00 PM
SparKeh SparKeh is offline
 
Join Date: May 2004
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack, thanks
Reply With Quote
  #24  
Old 09-03-2006, 07:37 PM
Settler Settler is offline
 
Join Date: Jun 2005
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi, sorry for mine english.
but this hack don't work on my forum 3.6.0
can you say me, where the problem is?
thank you,
mfg Settler
Reply With Quote
  #25  
Old 09-03-2006, 07:53 PM
SparKeh SparKeh is offline
 
Join Date: May 2004
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Settler
hi, sorry for mine english.
but this hack don't work on my forum 3.6.0
can you say me, where the problem is?
thank you,
mfg Settler
If you follow the instructions step by step as listed it should work no problem. Did you place the javascript file in the clientscript folder?
Reply With Quote
  #26  
Old 09-04-2006, 09:46 AM
dtdesign dtdesign is offline
 
Join Date: Feb 2002
Location: Ireland
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this be used in Journal Pages to do the same ?
Reply With Quote
  #27  
Old 09-04-2006, 12:16 PM
mIRCnet's Avatar
mIRCnet mIRCnet is offline
 
Join Date: Nov 2001
Location: UAE
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dtdesign
Can this be used in Journal Pages to do the same ?
Which Journal program do you use? I think if you are using vBadvanced CMPS it will work as its using the Forum BB Codes and settings.
Reply With Quote
  #28  
Old 09-04-2006, 04:43 PM
ehsanix ehsanix is offline
 
Join Date: Oct 2003
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank u for this hack
Reply With Quote
  #29  
Old 09-07-2006, 07:15 PM
janslu janslu is offline
 
Join Date: May 2006
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

mr.gamesbay,
you've made a terrific job. I am importing a large forum from smf to VB and I got tons of extremely large files that ruin my fluid xhtml page. Your hack saves me

There's just one thing that I think should be changed. It is illegal to declare more than one object with the same id on the same page. I think you should've used class for declaration:

1. for includes/class_bbcode.php:
Code:
return '<img src="' .  $link . '" border="0" alt="" class="vBCodeIMG" />';
2. and one change in line #11 of resizevbimg.js:
Code:
if (docImg[i].width > vbimgcodeWidthMax && docImg[i].className == 'vBCodeIMG') {
What do you think?
Reply With Quote
  #30  
Old 09-09-2006, 11:05 PM
g0rdy g0rdy is offline
 
Join Date: Oct 2003
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works with vBadvanced too:

mod the adv_portal template

find
Code:
<body>
replace
Code:
<body onload="$onload;vbImageResize()">
such an important mod never understood why it is never included on any bb software
Reply With Quote
  #31  
Old 09-10-2006, 05:46 PM
Aeolian Aeolian is offline
 
Join Date: Apr 2004
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if only this was a plugin
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 05:28 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.05083 seconds
  • Memory Usage 2,312KB
  • 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
  • (13)bbcode_code
  • (2)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
  • (1)pagenav_pagelinkrel
  • (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