[req]Auto Resize large images in an IMG tag

Hoxxy

New Member
I have already posted this hack but also cant find it so here you go....

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.


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



PHP:
return '<img src="' .  $link . '" border="0" alt="" />';

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

Save and upload.


Styles & Templates > Search the SHOWTHREAD Template

Seach:
PHP:
<body onload="$onload">

Replace with:
PHP:
<body onload="$onload;vbImageResize()">

Save the template.


Styles & Templates > Search the NEWREPLY Template
Search:
PHP:
<body$onload>

Replace with:
PHP:
<body onload="$onload;vbImageResize()">

Save the template.


- Styles & Templates > Style Manager > Common Templates > headinclude

Search:
PHP:
<!-- / CSS Stylesheet -->

After, add:
PHP:
<script type="text/javascript" src="clientscript/resizevbimg.js"></script>

Save the template.


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

After, add:

PHP:
.vbimgcodelimit {
        cursor: pointer;
        border: dotted 1px black;
}

Save.
 

pinoydls

New Member
it is possible this works to 3.8.1 too?

Edit:

hey thanks alot its also worked in 3.8.1 but images is open on new window but its ok;) atleast its resized
 

litu2009

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

After, add:

PHP Code:
.vbimgcodelimit {
cursor: pointer;
border: dotted 1px black;
}
Save.

When I try this it shows this error

9u4rrl.jpg
 

peeyooshk

New Member
It works with 3.8.1 but does not show any tag above the image stating the image has been resized. Is there something additional to be done for that?
 
Top