vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Show Thread Enhancements - Auto Resize large images in an IMG tag (https://vborg.vbsupport.ru/showthread.php?t=169889)

mr.gamesbay 02-06-2008 10:00 PM

Auto Resize large images in an IMG tag
 
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.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 :)

Magnumutz 02-07-2008 02:17 PM

Nice, it's almost as spleasure's resize mod.

Is there any way you can choose the minimum size that the mod resizes?

KURTZ 02-07-2008 02:20 PM

i think THIS is better :)

Magnumutz 02-07-2008 02:27 PM

That's for 3.6 this one is specially made for 3.7...
Don't be an ass.

mr.gamesbay 02-07-2008 02:27 PM

Quote:

Originally Posted by KURTZ (Post 1438225)
i think THIS is better :)

Then use it! ;)
I don't need and want for img resizes DB queries. ^^

KURTZ 02-07-2008 02:31 PM

Quote:

Originally Posted by Magnumutz (Post 1438234)
That's for 3.6 this one is specially made for 3.7...
Don't be an ass.

yeah, but runs perfectly also on 3.7.x ... ;)

Quote:

Originally Posted by mr.gamesbay (Post 1438235)
Then use it! ;)
I don't need and want for img resizes DB queries. ^^

absolutely, it's only a different way ... :)

mr.gamesbay 02-07-2008 02:52 PM

Quote:

Originally Posted by Magnumutz (Post 1438222)
Is there any way you can choose the minimum size that the mod resizes?

Yes you can.

Open the resizevbimg.js with an text editor and change the two values (500 is default size) to your new minimum size.

cosy 02-07-2008 02:55 PM

is there any way install whit out all that edits ?

Jase2 02-07-2008 03:08 PM

No there isn't. The instructions are very easy to follow.

Nice add on.

Regards Jason :)

skrazydogz 02-07-2008 03:41 PM

is it compatible with vb 3.6.8 ?

vnairp11 02-07-2008 03:48 PM

thanks a lot works beautifullly

projectego 02-07-2008 08:06 PM

[high]* projectego clicks install :)[/high]

StuntFactoryX 02-07-2008 11:12 PM

looks promising.. is there a way to add a "click to enlarge" ? i dont think many will relize you can make it bigger..

a light box add on would be really cool too :)

Magnumutz 02-09-2008 07:14 AM

Ok, it's got a downside... when clicking pictures that are linked to something, it shows the full image but also goes to the link... that's not very nice.

Good work on it, but i think i'll switch back.

BBF 02-09-2008 11:06 AM

can you add a message like "click here to enlarge the image"?

ntloc 02-10-2008 04:38 PM

Nice, works on 3.6.8 PL2
Thank you. installed!

logicuk 04-04-2008 09:29 AM

ive been searching for a working image resize mod for vb 3.7 b5 for a long time

and yours work thanks alot

rapidphim 04-14-2008 06:53 AM

1/ Can you create this mod with lightbox intergration?
2/ Then, can you intergrate this mod with this hack https://vborg.vbsupport.ru/showthread.php?t=173353 ?

thestaton 05-12-2008 11:51 AM

thank you for an excellent mod. works like a charm on 3.7 Gold.

Super Jinni 05-16-2008 12:37 PM

thank you man

can you make it open the resized image in the same window?

is it possible avoiding opening any link included within the image location link?

thank you for your nice work

:)

Razasharp 05-16-2008 05:03 PM

Quote:

Originally Posted by Super Jinni (Post 1521542)
thank you man

can you make it open the resized image in the same window?

Seconded :)

minus19 05-17-2008 12:09 PM

Erm, you can just use a couple of lines of CSS to do this...

Ark del KAOS 05-20-2008 08:23 PM

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

EDIT: And the same with adv_portal if you're using VBA

Doctor Death 05-20-2008 09:38 PM

Will this also resize images in a users photo album?

rigodiaz 05-24-2008 02:47 AM

Quote:

Originally Posted by Ark del KAOS (Post 1526082)
EDIT: And the same with adv_portal if you're using VBA

Excelent:up:!

I was looking for this :eek:


Thank you, Installed!!!

tspore 05-29-2008 04:50 AM

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?

MaXeL3G3ND 06-26-2008 02:10 PM

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

aramiK89 06-29-2008 10:42 AM

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!

harlita 07-01-2008 11:01 AM

hack reinstalled on multiple themes on a 3.7.2 forum. works like a charm.

Mazinger 12-15-2008 10:57 AM

It doesn't resize PNGs???

Dabbi 01-13-2009 01:34 PM

This was exactly what I needed.. thank you. :)

I don't know why it's not included with vB "out of the box" at least as an option since it makes so much sense if you allow [IMG].

thedvs 05-23-2009 06:30 PM

works great on 3.8.2

thedvs 07-02-2009 11:21 AM

works on 3.8.3

Birute 10-14-2009 12:13 AM

This works good, thanks!!
It works on 3.8.4 PL1

Earth's Banner

Helmut71 10-14-2009 07:22 AM

In which way do I have to edit the SHOWTHREAD_SHOWPOST so that this add on works with it?

iheartvb 10-25-2009 12:50 AM

i tried this and it doesn't work. what am i doing wrong?? i have 3.8.2

ibob 01-27-2010 07:13 PM

Quote:

Originally Posted by ppatil007 (Post 1963644)
does is work for 3.8?

Yes.

thedvs 09-20-2010 02:02 PM

can someone do the coding for this for 4.0.7?

thedvs 09-28-2010 09:04 AM

ah well


All times are GMT. The time now is 02:45 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.01359 seconds
  • Memory Usage 1,789KB
  • 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
  • (12)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (39)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete