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!

Get Shorty 09-01-2006 05:26 PM

Quote:

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

This hack does the same thing...

https://vborg.vbsupport.ru/showthread.php?t=118048

Quarterbore 09-01-2006 07:08 PM

Mine is not resizing either... This should work for all usergroups, right?

It may be my work lapptop as I have to use an older Java because of some specific apps I need... I'll see later if it works on other machines?

MentaL 09-01-2006 07:17 PM

great u sexy piece of ass.

Alex_ 09-01-2006 07:31 PM

What happens with
[ url=blar ][ img ][ /img ][ /url ]
constructs? Which link will not work?

// Edit - hmhm url tags are converted within code boxes?!

Snake 09-01-2006 11:01 PM

Do you have some kind of a screenshot or something?

Y@M 09-01-2006 11:15 PM

First time i replay to someone.
Grate hack! Grate idea!
Thanks.

Quarterbore 09-01-2006 11:38 PM

Well, I just double checked my install and tested on Win XP SP1, Win XP SP and Windows 2000 and she don't work on my site... I am going to take it back off and try the other one :surprised:

Thanks for sharing as I need this bad but it doesn't like my setup I guess...

007 09-02-2006 04:02 AM

What kind of effect does this have on server load?

maximux1 09-02-2006 06:38 PM

Fantastic job on this -

We run an image heavy site with predefined dimensions and this method solves a huge layout problem for us.

R+

mIRCnet 09-03-2006 10:50 AM

Works like a charm on new posts with images, what about the old posts? do I have to reuild the threads cache?
Update: no need to do any thing as its based on JavaScript and will work automaticly, for the past posts it will show the orginal size then resize when the page done loading.

twitch 09-03-2006 05:24 PM

very nice, thanks

SparKeh 09-03-2006 07:00 PM

great hack, thanks

Settler 09-03-2006 07:37 PM

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

SparKeh 09-03-2006 07:53 PM

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?

dtdesign 09-04-2006 09:46 AM

Can this be used in Journal Pages to do the same ?

mIRCnet 09-04-2006 12:16 PM

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.

ehsanix 09-04-2006 04:43 PM

thank u for this hack

janslu 09-07-2006 07:15 PM

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?

g0rdy 09-09-2006 11:05 PM

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

Aeolian 09-10-2006 05:46 PM

if only this was a plugin :(

bolly.beats 09-11-2006 09:09 PM

Lol, didnt worked for me bro, but nice effort.

troux 09-12-2006 08:06 PM

INSTALLED. Works perfect.

Mдяc 09-14-2006 05:02 AM

yup, nice mods !! juz installed

premsuthan 09-14-2006 10:04 AM

working great, thx a lot

Codeman05 09-16-2006 03:41 AM

works great, thanks!

teedizz 09-16-2006 06:19 AM

will this work with 3.6.1

teedizz 09-18-2006 02:29 AM

Quote:

Originally Posted by teedizz
will this work with 3.6.1

same question, different day....lol

Zia 09-18-2006 10:37 AM

hi..

it is resizing the image (decrease size) , not adding scroll bar ??

remasnet 09-18-2006 05:48 PM

great great great , installed and work perfect thanks man

iran.gs 09-20-2006 12:59 PM

Installed, all i can say is wow


All times are GMT. The time now is 05:21 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.01423 seconds
  • Memory Usage 1,795KB
  • 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
  • (13)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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