vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Display Enhancements - Auto Resize large images in an IMG tag (https://vborg.vbsupport.ru/showthread.php?t=125500)

mr.gamesbay 08-31-2006 10:00 PM

Auto Resize large images in an IMG tag
 
First, sorry about my bad english :rolleyes:

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 :)

Terminatoronly 09-01-2006 12:40 PM

wow good hack :) installed ;)

Kaezul 09-01-2006 12:51 PM

Nice job. I've seen this done before, but never on [IMG] tags. Fantastic work.

principino1984 09-01-2006 01:24 PM

I just installed this hack, but...how does it work? I tried to upload a new pic, but it doens't resize it..

Marco

thedvs 09-01-2006 01:59 PM

that is one of the best mini hacks released for ages, many many thanks dude.
works in ie/firefox

FleaBag 09-01-2006 02:38 PM

I just came here to look for something like this after a member posted gigantic pictures! Thanks. :)

mr.gamesbay 09-01-2006 03:16 PM

Quote:

Originally Posted by principino1984
I just installed this hack, but...how does it work? I tried to upload a new pic, but it doens't resize it..

Marco

All large images in an IMG Tag will be resized like in the demo URL in my first post :)

spetactical 09-01-2006 04:27 PM

Great work!

asj 09-01-2006 04:37 PM

Thanks for man

alkatraz 09-01-2006 04:54 PM

Quote:

Originally Posted by mr.gamesbay
All large images in an IMG Tag will be resized like in the demo URL in my first post :)

are the images physicaly resized or do they just display at a smaller size?
edit: looks like it loads the full image then resizes it on the fly

GREAT HACK! THANKS

update: installed and works perfectly!


All times are GMT. The time now is 01:56 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01250 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete