PDA

View Full Version : Auto Image Resize


RaceJunkies
12-14-2003, 02:09 PM
Hello anyone,

I need a script or hack that will automaticaly resize images posted by a user with the [IMG] tags...

So any huge images will not screw up my forum tables....

I tried some that I found here but none worked with me...

I am running 2.3.0....

Thank in advance!

Gary King
12-14-2003, 06:14 PM
An alternative would be to simply disable the [img] tags, but that's just a suggestion.

vietfancy
03-19-2005, 03:03 AM
Open includes/functions_bbcodeparse.php

search for:
function handle_bbcode_img_match($link)
{
$link = strip_smilies(str_replace('\\"', '"', $link));

// remove double spaces -- fixes issues with wordwrap
$link = str_replace(' ', '', $link);

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

Replace with this code:

function handle_bbcode_img_match($link)
{
global $vboptions;

$link = strip_smilies(str_replace('\\"', '"', $link));

// remove double spaces -- fixes issues with wordwrap
$link = str_replace(' ', '', $link);

if ($vboptions['legacypostbit'])
{
return '<a href=' . $link . ' target="_blank"><img src="' . $link . '" onload="if(this.width>screen.width-255) {this.width=screen.width-255;this.alt=\'Full View\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" border="0"></a>';
}
else
{
return '<a href=' . $link . ' target="_blank"><img src="' . $link . '" onload="if(this.width>screen.width-80) {this.width=screen.width-80;this.alt=\'Full View\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" border="0"></a>';
}
}

mustang_lex
06-04-2005, 08:24 PM
It worked but not in preview thread. only after submit. Anywhere else we need to post this?