Hi!
ich hätte da einen vorschlag,vielleicht möchte @mawenzi das in seinen script übernehmen.
function get_thumbnail_small_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
global $site_sess, $config, $site_template;
//####### Config ###############################
$maxwidth = "80"; // pixel
//####### Config ###############################
if (!check_media_type($media_file_name)) {
$thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" >";
}
else {
if (!get_file_path($media_file_name, "media", $cat_id, 0, 0)) {
$file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
$image_info = @getimagesize($file_src);
$thumb_width = $image_info[0]."px";
$thumb_height = $image_info[1]."px";
$thumb = "<img src=\"".$file_src."\" style=\"border:0px;width:$thumb_width; height:$thumb_height;\" alt=\"".format_text($image_name, 2)."\" >";
}
else {
$file_src = get_file_path($media_file_name, "media", $cat_id, 0, 1);
$image_info = @getimagesize($file_src);
$thumb_width = $image_info[0];
$thumb_height = $image_info[1];
if ($thumb_width > $maxwidth){
$imageprop=$maxwidth/$thumb_width;
$imagevsize= $thumb_height*$imageprop;
$thumb_width=$maxwidth."px";
$thumb_height= round($imagevsize)."px";
}
else{
$thumb_width = $image_info[0]."px";
$thumb_height = round($image_info[1])."px";
}
$thumb = "<img src=\"".$file_src."\" style=\"border:".$config['image_border']."px solid;width:$thumb_width; height:$thumb_height;\" alt=\"".format_text($image_name, 2)."\">";
}
}
if ($show_link) {
if ($open_window) {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))." #z1\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
}
else {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))." #z1\">".$thumb."</a>";
}
}
return $thumb;
}
mit $max = 80; wird die Weite angegeben, und das Seitenverhältniss bleibt immer gleich.
mfg Andi