I wish I had found this months ago...great hack Z
However, I think the install .txt file may have gotten trunked somehow. This is all I am getting:
PHP Code:
This hack adds a new tag to your forums that will allow you to post images
in the form of a thumbnail.
The tag allows you to post pictures in the form of a thumbnail. Large images
can throw off the page, and the tag will scale the picture down to an 80x60
thumbnail preserving its original length and width ratio and turn it into a
hyperlink that you can click on and see the full image in a new browser window.
If the image being thumbnailed is smaller than 80x60, it will show up as is.
This tag is identical to the IMG tag.
Tables affected: none
Templates affected: none
Files affected: admin/functions.php
Check out this link for a demo: [url]http://www.ls1.com/forums/showthread.php?s=&threadid=276879[/url]
*************************************************************************************
Note: This tag does not resize the actual picture. It just displays them at a smaller
scale. It will not help with bandwidth preservation.
*************************************************************************************
In admin/functions.php
Look for:
$bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts
return censortext($bbcode);
And change it to:
$bbcode=str_replace("{", "{", $bbcode); // stop people posting replacements in their posts
$bbcode=preg_replace("/\[thumb\](\r\n|\r|\n)*((http|https):\/\/([^;<>\(\)\"".iif($allowdynimg,"","!\*\?\&")."]+)|[a-z0-9\/\\\._\- ]+)\[\/thumb\]/esiU", "dothumb('\\2')", $bbcode);
return censortext($bbcode);
########################################
In admin/functions.php
look for:
// ###################### Start phphighlite #######################
Add the following directly above it:
// ###################### Start dothumb #######################
function dothumb($code) {
$img_info = @getimagesize($code);
if($img_info[0]) {
if(($img_info[0] <= 80) and ($img_info[1] <= 60)) {
$code = "<a href=\"$code\" target=\"_blank\"><img src=\"$code\"></a>";
}
else {
$xratio = $img_info[0] / 80;
$yratio = $img_info[1] / 60;
$factor = $xratio;
if($yratio > $xratio) {
$factor = $yratio;
}
$xsize = intval($img_info[0] / $factor);
$ysize = intval($img_info[1] / $factor);
$code="<a href=\"$code\" target=\"_blank\"><img src=\"$code\" width=\"$xsize\" height=\"$ysize\" border=\"3\"></a>";
}
}
return($code);
}
I did this and the tag isn't working...don't I have to add a BBcode via the admin control panel as well?