Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 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: Show Thread Enhancements - Version: 3.7.x Rating:
Released: 02-06-2008 Last Update: Never Installs: 70
Template Edits
Code Changes Additional Files  
No support by the author.

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.7.x

INSTALLATION:

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

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

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

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

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 05-16-2008, 05:03 PM
Razasharp's Avatar
Razasharp Razasharp is offline
 
Join Date: Feb 2005
Location: UK
Posts: 373
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Super Jinni View Post
thank you man

can you make it open the resized image in the same window?
Seconded
Reply With Quote
  #23  
Old 05-17-2008, 12:09 PM
minus19 minus19 is offline
 
Join Date: May 2008
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Erm, you can just use a couple of lines of CSS to do this...
Reply With Quote
  #24  
Old 05-20-2008, 08:23 PM
Ark del KAOS's Avatar
Ark del KAOS Ark del KAOS is offline
 
Join Date: Sep 2002
Location: Madrid, Spain
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey, the SHOWTHREAD_SHOWPOST must get the onload extra code as well ^ ^

EDIT: And the same with adv_portal if you're using VBA
Reply With Quote
  #25  
Old 05-20-2008, 09:38 PM
Doctor Death Doctor Death is offline
 
Join Date: Dec 2005
Posts: 449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this also resize images in a users photo album?
Reply With Quote
  #26  
Old 05-24-2008, 02:47 AM
rigodiaz rigodiaz is offline
 
Join Date: Jul 2006
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ark del KAOS View Post
EDIT: And the same with adv_portal if you're using VBA
Excelent:up:!

I was looking for this


Thank you, Installed!!!
Reply With Quote
  #27  
Old 05-29-2008, 04:50 AM
tspore tspore is offline
 
Join Date: Jan 2006
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I have edited the values in the JS -
Code:
var vbimgcodeWidthMax = 800;
var vbimgcodeWidthSizeTo = 800;
as well as 600, 650, etc. and it isn't picking showing the link to a bigger photo.... What am I doing wrong?
Reply With Quote
  #28  
Old 06-26-2008, 02:10 PM
MaXeL3G3ND MaXeL3G3ND is offline
 
Join Date: Dec 2007
Location: ::1
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't forget the template SHOWTHREAD_SHOWPOST
(added the script to load on that as well myself : ) , just a heads up)

I like this script and if you want to change how it works people, then
you should edit the javascript file, as that both contains which size it
resizes the image to, by default 500x500, and also a default message.

Snip of what resizevbimg.js includes:
Code:
var vbimgcodeResizeMsg = 'Resized image! Click for original size!';
var vbimgcodeWidthMax = 500;
var vbimgcodeWidthSizeTo = 500;
To make it resize to maybe 600x 600 and the message: "Click here to enlarge the image" :
Code:
var vbimgcodeResizeMsg = 'Click here to enlarge the image';
var vbimgcodeWidthMax = 600;
var vbimgcodeWidthSizeTo = 600;
It's very simple and you shouldn't ask the dev to do this easy work : )
Reply With Quote
  #29  
Old 06-29-2008, 10:42 AM
aramiK89 aramiK89 is offline
 
Join Date: Jun 2008
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey, just need to check - once this is added it won't give birth to the security token error?

Has the line of code been added so that it works with the security token feature?

Just been having a lot of issues with this + mods

Thanks!
Reply With Quote
  #30  
Old 07-01-2008, 11:01 AM
harlita harlita is offline
 
Join Date: Dec 2006
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hack reinstalled on multiple themes on a 3.7.2 forum. works like a charm.
Reply With Quote
  #31  
Old 12-15-2008, 10:57 AM
Mazinger's Avatar
Mazinger Mazinger is offline
 
Join Date: Nov 2006
Location: Egypt
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It doesn't resize PNGs???
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 01:49 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.06471 seconds
  • Memory Usage 2,317KB
  • 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
  • (12)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
  • (3)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