Dazu müsstest ihr in der include/includes/js/BBCodeGlobals.js folgende Funktion einfügen
function SetSize(img,maxw,maxh){
var w = img.width;
var h = img.height;
if (w>maxw) {
h = maxw * h / w;
w = maxw;
}
if (h>maxh) {
w = maxh * w / h;
h = maxh;
}
img.width = w;
img.height = h;
}
Und dann noch in der include/includes/class/bbcode.php
Die Funktion
//> Bilder auf Maximale größen überprüfen.
function _img($string) {
//> Information des Bildes Laden.
$img_info = @getimagesize($string);
if(!function_exists(getimagesize) || empty($img_info[0])) {
$image = "<img src=\"".$string."\" alt=\"\" title=\"\" border=\"0\">";
} else {
if($img_info[1] <= $this->info['ImgMaxHoehe'] && $img_info[0] <= $this->info['ImgMaxBreite']) {
$image = "<img src=\"".$string."\" ".$img_info[3]." alt=\"\" title=\"\" border=\"0\">";
} else {
$img_width = $this->info['ImgMaxBreite'] / $img_info[0];
$img_height = $this->info['ImgMaxHoehe'] /$img_info[1];
if($img_width < $img_height) {
$new_width = $img_info[0] * $img_width;
$new_height = $img_info[1] * $img_width;
} else {
$new_width = $img_info[0] * $img_height;
$new_height = $img_info[1] * $img_height;
}
$image = "<a href=\"".$string."\" target=\"_BLANK\"><img src=\"".$string."\" width=\"".sprintf("%00d",$new_width)."\" height=\"".sprintf("%00d",$new_height)."\" alt=\"\" title=\"\" border=\"0\"></a>";
}
}
return $image;
} durch diese hier ersetzen
//> Bilder auf Verkleinern via Javascript überprüfen.
function _img($string) {
$image = '<img src="'.$string.'" alt="" title="" border="0" onload="SetSize(this,'.$this->info['ImgMaxBreite'].','.$this->info['ImgMaxHoehe'].');"/>';
return $image;
}
Ich hab dies auch in den BBCode 2.0 für 1.1D mit integriert. Bei Fehlern bitte hier posten.
verwendete ilchClan Version: 1.1


