Code: Alles auswählen
<?php
$viewer = "/contenidoawo/awo/js/viewer.php"; // image viewer for popups
$thm_dir = "CMS_VALUE[5]"? "CMS_VALUE[5]": "thumb"; // thumb dir - default "thm"
$thm_maxw = intval("CMS_VALUE[6]"); // max width thumb
$thm_maxh = intval("CMS_VALUE[7]"); // max height thumb
$thm_qual = "CMS_VALUE[9]"? intval("CMS_VALUE[9]"): 80; //quality jpeg
$show_popup = "CMS_VALUE[8]"? true: false; // show popup yes/no
$align = "CMS_VALUE[10]"? 'align="CMS_VALUE[10]"': ""; // align thumb
$img_src = "CMS_IMG[10]"; // src of image
$img_lnk = "CMS_LINK[10]"; // image link
$img_tgt = "CMS_LINKTARGET[10]"; // target of imagelink
$img_path = str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $img_src);
if ( $img_src && file_exists($img_path) )
{
unset ($ratio);
$img_size = getimagesize ($img_path);
if ( $thm_maxw>0 )
{
$ratio = $thm_maxw/$img_size[0];
$thm_w = $thm_maxw;
$thm_h = round($ratio*$img_size[1]);
}
if ( $thm_maxh>0 )
{
$rh = $thm_maxh/$img_size[1];
$ratio = ( $ratio>$rh? $rh: $ratio );
$thm_w = round($ratio*$img_size[0]);
$thm_h = $thm_maxh;
}
$thm_src = $img_src;
if ( is_numeric($ratio) && $ratio<1 )
{
// use thumb, resize image
$thm_src = dirname($img_src)."/$thm_dir/".basename($img_src);
$thm_path = dirname($img_path)."/$thm_dir/".basename($img_path);
$flag_create = !file_exists($thm_path);
if ( !$flag_create )
{
$thm_size = getimagesize ( $thm_path );
if ( !$thm_size || $thm_size[0]!=$thm_w )
{
$flag_create = true;
}
}
if ( $flag_create )
{ // make thumb
if ( !file_exists(dirname($thm_path)) ) mkdir(dirname($thm_path),777);
unset($i);
switch ( exif_imagetype($img_path) )
{
case IMAGETYPE_GIF:
$i = imagecreatefromgif($img_path);
break;
case IMAGETYPE_JPEG:
$i = imagecreatefromjpeg($img_path);
break;
case IMAGETYPE_PNG:
$i = imagecreatefrompng($img_path);
break;
case IMAGETYPE_BMP:
$i = imagecreatefromwbmp($img_path);
break;
case IMAGETYPE_SWF:
case IMAGETYPE_PSD:
case IMAGETYPE_TIFF_II:
case IMAGETYPE_TIFF_MM:
case IMAGETYPE_JPC:
case IMAGETYPE_JP2:
case IMAGETYPE_JPX:
case IMAGETYPE_SWC:
default:
$i = imagecreatefromxbm($fsrc);
} //detect image type
if ( $i )
{
$thm = imagecreatetruecolor($thm_w,$thm_h);
imagecolortransparent($thm,imagecolorat($i,0,0));
imagecopyresampled($thm,$i,0,0,0,0,$thm_w,$thm_h,$img_size[0],$img_size[1]) &&
imagejpeg($thm,$thm_path,$thm_qual);
imagedestroy($thm);
imagedestroy($i);
}
} // create thumb
} // $ratio<1
$img = sprintf('<img src="%s" border="0" %s>',$thm_src,$align);
$slf = "http://" . $_SERVER['HTTP_HOST'] . dirname($PHP_SELF) . "/";
if ( $img_lnk != "http://" && $img_lnk != $slf )
{
$img = sprintf('<a href="%s" target="%s">%s</a>',$img_lnk,$img_tgt,$img);
}
elseif ( $show_popup )
{
$img = sprintf('<a href="%s?img=%s" target="_blank">%s</a>',$viewer,urlencode($img_src),$img );
}
echo $img;
} // $img_src!=""
if ( $contenido || "CMS_IMGDESCR[10]" )
{
echo "<br>";
echo "CMS_IMGDESCR[10]";
}
if ( $contenido || "CMS_LINKDESCR[10]" )
{
echo "<br>";
echo "CMS_LINKDESCR[10]";
}
echo "<br>";
////zweites Bild
$img_src = "CMS_IMG[11]"; // src of image
$img_lnk = "CMS_LINK[11]"; // image link
$img_tgt = "CMS_LINKTARGET[11]"; // target of imagelink
$img_path = str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $img_src);
if ( $img_src && file_exists($img_path) )
{
unset ($ratio);
$img_size = getimagesize ($img_path);
if ( $thm_maxw>0 )
{
$ratio = $thm_maxw/$img_size[0];
$thm_w = $thm_maxw;
$thm_h = round($ratio*$img_size[1]);
}
if ( $thm_maxh>0 )
{
$rh = $thm_maxh/$img_size[1];
$ratio = ( $ratio>$rh? $rh: $ratio );
$thm_w = round($ratio*$img_size[0]);
$thm_h = $thm_maxh;
}
$thm_src = $img_src;
if ( is_numeric($ratio) && $ratio<1 )
{
// use thumb, resize image
$thm_src = dirname($img_src)."/$thm_dir/".basename($img_src);
$thm_path = dirname($img_path)."/$thm_dir/".basename($img_path);
$flag_create = !file_exists($thm_path);
if ( !$flag_create )
{
$thm_size = getimagesize ( $thm_path );
if ( !$thm_size || $thm_size[0]!=$thm_w )
{
$flag_create = true;
}
}
if ( $flag_create )
{ // make thumb
if ( !file_exists(dirname($thm_path)) ) mkdir(dirname($thm_path),0777);
unset($i);
switch ( exif_imagetype($img_path) )
{
case IMAGETYPE_GIF:
$i = imagecreatefromgif($img_path);
break;
case IMAGETYPE_JPEG:
$i = imagecreatefromjpeg($img_path);
break;
case IMAGETYPE_PNG:
$i = imagecreatefrompng($img_path);
break;
case IMAGETYPE_BMP:
$i = imagecreatefromwbmp($img_path);
break;
case IMAGETYPE_SWF:
case IMAGETYPE_PSD:
case IMAGETYPE_TIFF_II:
case IMAGETYPE_TIFF_MM:
case IMAGETYPE_JPC:
case IMAGETYPE_JP2:
case IMAGETYPE_JPX:
case IMAGETYPE_SWC:
default:
$i = imagecreatefromxbm($fsrc);
} //detect image type
if ( $i )
{
$thm = imagecreatetruecolor($thm_w,$thm_h);
imagecolortransparent($thm,imagecolorat($i,0,0));
imagecopyresampled($thm,$i,0,0,0,0,$thm_w,$thm_h,$img_size[0],$img_size[1]) &&
imagejpeg($thm,$thm_path,$thm_qual);
imagedestroy($thm);
imagedestroy($i);
}
} // create thumb
} // $ratio<1
$img = sprintf('<img src="%s" border="0" %s>',$thm_src,$align);
$slf = "http://" . $_SERVER['HTTP_HOST'] . dirname($PHP_SELF) . "/";
if ( $img_lnk != "http://" && $img_lnk != $slf )
{
$img = sprintf('<a href="%s" target="%s">%s</a>',$img_lnk,$img_tgt,$img);
}
elseif ( $show_popup )
{
$img = sprintf('<a href="%s?img=%s" target="_blank">%s</a>',$viewer,urlencode($img_src),$img );
}
echo $img;
} // $img_src!=""
if ( $contenido || "CMS_IMGDESCR[11]" )
{
echo "<br>";
echo "CMS_IMGDESCR[11]";
}
if ( $contenido || "CMS_LINKDESCR[11]" )
{
echo "<br>";
echo "CMS_LINKDESCR[11]";
}
echo "<br>";
////drittes Bild
$img_src = "CMS_IMG[12]"; // src of image
$img_lnk = "CMS_LINK[12]"; // image link
$img_tgt = "CMS_LINKTARGET[12]"; // target of imagelink
$img_path = str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $img_src);
if ( $img_src && file_exists($img_path) )
{
unset ($ratio);
$img_size = getimagesize ($img_path);
if ( $thm_maxw>0 )
{
$ratio = $thm_maxw/$img_size[0];
$thm_w = $thm_maxw;
$thm_h = round($ratio*$img_size[1]);
}
if ( $thm_maxh>0 )
{
$rh = $thm_maxh/$img_size[1];
$ratio = ( $ratio>$rh? $rh: $ratio );
$thm_w = round($ratio*$img_size[0]);
$thm_h = $thm_maxh;
}
$thm_src = $img_src;
if ( is_numeric($ratio) && $ratio<1 )
{
// use thumb, resize image
$thm_src = dirname($img_src)."/$thm_dir/".basename($img_src);
$thm_path = dirname($img_path)."/$thm_dir/".basename($img_path);
$flag_create = !file_exists($thm_path);
if ( !$flag_create )
{
$thm_size = getimagesize ( $thm_path );
if ( !$thm_size || $thm_size[0]!=$thm_w )
{
$flag_create = true;
}
}
if ( $flag_create )
{ // make thumb
if ( !file_exists(dirname($thm_path)) ) mkdir(dirname($thm_path),0777);
unset($i);
switch ( exif_imagetype($img_path) )
{
case IMAGETYPE_GIF:
$i = imagecreatefromgif($img_path);
break;
case IMAGETYPE_JPEG:
$i = imagecreatefromjpeg($img_path);
break;
case IMAGETYPE_PNG:
$i = imagecreatefrompng($img_path);
break;
case IMAGETYPE_BMP:
$i = imagecreatefromwbmp($img_path);
break;
case IMAGETYPE_SWF:
case IMAGETYPE_PSD:
case IMAGETYPE_TIFF_II:
case IMAGETYPE_TIFF_MM:
case IMAGETYPE_JPC:
case IMAGETYPE_JP2:
case IMAGETYPE_JPX:
case IMAGETYPE_SWC:
default:
$i = imagecreatefromxbm($fsrc);
} //detect image type
if ( $i )
{
$thm = imagecreatetruecolor($thm_w,$thm_h);
imagecolortransparent($thm,imagecolorat($i,0,0));
imagecopyresampled($thm,$i,0,0,0,0,$thm_w,$thm_h,$img_size[0],$img_size[1]) &&
imagejpeg($thm,$thm_path,$thm_qual);
imagedestroy($thm);
imagedestroy($i);
}
} // create thumb
} // $ratio<1
$img = sprintf('<img src="%s" border="0" %s>',$thm_src,$align);
$slf = "http://" . $_SERVER['HTTP_HOST'] . dirname($PHP_SELF) . "/";
if ( $img_lnk != "http://" && $img_lnk != $slf )
{
$img = sprintf('<a href="%s" target="%s">%s</a>',$img_lnk,$img_tgt,$img);
}
elseif ( $show_popup )
{
$img = sprintf('<a href="%s?img=%s" target="_blank">%s</a>',$viewer,urlencode($img_src),$img );
}
echo $img;
} // $img_src!=""
if ( $contenido || "CMS_IMGDESCR[12]" )
{
echo "<br>";
echo "CMS_IMGDESCR[12]";
}
if ( $contenido || "CMS_LINKDESCR[12]" )
{
echo "<br>";
echo "CMS_LINKDESCR[12]";
}
echo "<br>";
////viertes Bild
$img_src = "CMS_IMG[13]"; // src of image
$img_lnk = "CMS_LINK[13]"; // image link
$img_tgt = "CMS_LINKTARGET[13]"; // target of imagelink
$img_path = str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $img_src);
if ( $img_src && file_exists($img_path) )
{
unset ($ratio);
$img_size = getimagesize ($img_path);
if ( $thm_maxw>0 )
{
$ratio = $thm_maxw/$img_size[0];
$thm_w = $thm_maxw;
$thm_h = round($ratio*$img_size[1]);
}
if ( $thm_maxh>0 )
{
$rh = $thm_maxh/$img_size[1];
$ratio = ( $ratio>$rh? $rh: $ratio );
$thm_w = round($ratio*$img_size[0]);
$thm_h = $thm_maxh;
}
$thm_src = $img_src;
if ( is_numeric($ratio) && $ratio<1 )
{
// use thumb, resize image
$thm_src = dirname($img_src)."/$thm_dir/".basename($img_src);
$thm_path = dirname($img_path)."/$thm_dir/".basename($img_path);
$flag_create = !file_exists($thm_path);
if ( !$flag_create )
{
$thm_size = getimagesize ( $thm_path );
if ( !$thm_size || $thm_size[0]!=$thm_w )
{
$flag_create = true;
}
}
if ( $flag_create )
{ // make thumb
if ( !file_exists(dirname($thm_path)) ) mkdir(dirname($thm_path),0777);
unset($i);
switch ( exif_imagetype($img_path) )
{
case IMAGETYPE_GIF:
$i = imagecreatefromgif($img_path);
break;
case IMAGETYPE_JPEG:
$i = imagecreatefromjpeg($img_path);
break;
case IMAGETYPE_PNG:
$i = imagecreatefrompng($img_path);
break;
case IMAGETYPE_BMP:
$i = imagecreatefromwbmp($img_path);
break;
case IMAGETYPE_SWF:
case IMAGETYPE_PSD:
case IMAGETYPE_TIFF_II:
case IMAGETYPE_TIFF_MM:
case IMAGETYPE_JPC:
case IMAGETYPE_JP2:
case IMAGETYPE_JPX:
case IMAGETYPE_SWC:
default:
$i = imagecreatefromxbm($fsrc);
} //detect image type
if ( $i )
{
$thm = imagecreatetruecolor($thm_w,$thm_h);
imagecolortransparent($thm,imagecolorat($i,0,0));
imagecopyresampled($thm,$i,0,0,0,0,$thm_w,$thm_h,$img_size[0],$img_size[1]) &&
imagejpeg($thm,$thm_path,$thm_qual);
imagedestroy($thm);
imagedestroy($i);
}
} // create thumb
} // $ratio<1
$img = sprintf('<img src="%s" border="0" %s>',$thm_src,$align);
$slf = "http://" . $_SERVER['HTTP_HOST'] . dirname($PHP_SELF) . "/";
if ( $img_lnk != "http://" && $img_lnk != $slf )
{
$img = sprintf('<a href="%s" target="%s">%s</a>',$img_lnk,$img_tgt,$img);
}
elseif ( $show_popup )
{
$img = sprintf('<a href="%s?img=%s" target="_blank">%s</a>',$viewer,urlencode($img_src),$img );
}
echo $img;
} // $img_src!=""
if ( $contenido || "CMS_IMGDESCR[13]" )
{
echo "<br>";
echo "CMS_IMGDESCR[13]";
}
if ( $contenido || "CMS_LINKDESCR[13]" )
{
echo "<br>";
echo "CMS_LINKDESCR[13]";
}
echo "<br>";
////fünftes Bild
$img_src = "CMS_IMG[14]"; // src of image
$img_lnk = "CMS_LINK[14]"; // image link
$img_tgt = "CMS_LINKTARGET[14]"; // target of imagelink
$img_path = str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $img_src);
if ( $img_src && file_exists($img_path) )
{
unset ($ratio);
$img_size = getimagesize ($img_path);
if ( $thm_maxw>0 )
{
$ratio = $thm_maxw/$img_size[0];
$thm_w = $thm_maxw;
$thm_h = round($ratio*$img_size[1]);
}
if ( $thm_maxh>0 )
{
$rh = $thm_maxh/$img_size[1];
$ratio = ( $ratio>$rh? $rh: $ratio );
$thm_w = round($ratio*$img_size[0]);
$thm_h = $thm_maxh;
}
$thm_src = $img_src;
if ( is_numeric($ratio) && $ratio<1 )
{
// use thumb, resize image
$thm_src = dirname($img_src)."/$thm_dir/".basename($img_src);
$thm_path = dirname($img_path)."/$thm_dir/".basename($img_path);
$flag_create = !file_exists($thm_path);
if ( !$flag_create )
{
$thm_size = getimagesize ( $thm_path );
if ( !$thm_size || $thm_size[0]!=$thm_w )
{
$flag_create = true;
}
}
if ( $flag_create )
{ // make thumb
if ( !file_exists(dirname($thm_path)) ) mkdir(dirname($thm_path),0777);
unset($i);
switch ( exif_imagetype($img_path) )
{
case IMAGETYPE_GIF:
$i = imagecreatefromgif($img_path);
break;
case IMAGETYPE_JPEG:
$i = imagecreatefromjpeg($img_path);
break;
case IMAGETYPE_PNG:
$i = imagecreatefrompng($img_path);
break;
case IMAGETYPE_BMP:
$i = imagecreatefromwbmp($img_path);
break;
case IMAGETYPE_SWF:
case IMAGETYPE_PSD:
case IMAGETYPE_TIFF_II:
case IMAGETYPE_TIFF_MM:
case IMAGETYPE_JPC:
case IMAGETYPE_JP2:
case IMAGETYPE_JPX:
case IMAGETYPE_SWC:
default:
$i = imagecreatefromxbm($fsrc);
} //detect image type
if ( $i )
{
$thm = imagecreatetruecolor($thm_w,$thm_h);
imagecolortransparent($thm,imagecolorat($i,0,0));
imagecopyresampled($thm,$i,0,0,0,0,$thm_w,$thm_h,$img_size[0],$img_size[1]) &&
imagejpeg($thm,$thm_path,$thm_qual);
imagedestroy($thm);
imagedestroy($i);
}
} // create thumb
} // $ratio<1
$img = sprintf('<img src="%s" border="0" %s>',$thm_src,$align);
$slf = "http://" . $_SERVER['HTTP_HOST'] . dirname($PHP_SELF) . "/";
if ( $img_lnk != "http://" && $img_lnk != $slf )
{
$img = sprintf('<a href="%s" target="%s">%s</a>',$img_lnk,$img_tgt,$img);
}
elseif ( $show_popup )
{
$img = sprintf('<a href="%s?img=%s" target="_blank">%s</a>',$viewer,urlencode($img_src),$img );
}
echo $img;
} // $img_src!=""
if ( $contenido || "CMS_IMGDESCR[14]" )
{
echo "<br>";
echo "CMS_IMGDESCR[14]";
}
if ( $contenido || "CMS_LINKDESCR[14]" )
{
echo "<br>";
echo "CMS_LINKDESCR[14]";
}
echo "<br>";
////sechstes Bild
$img_src = "CMS_IMG[15]"; // src of image
$img_lnk = "CMS_LINK[15]"; // image link
$img_tgt = "CMS_LINKTARGET[15]"; // target of imagelink
$img_path = str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $img_src);
if ( $img_src && file_exists($img_path) )
{
unset ($ratio);
$img_size = getimagesize ($img_path);
if ( $thm_maxw>0 )
{
$ratio = $thm_maxw/$img_size[0];
$thm_w = $thm_maxw;
$thm_h = round($ratio*$img_size[1]);
}
if ( $thm_maxh>0 )
{
$rh = $thm_maxh/$img_size[1];
$ratio = ( $ratio>$rh? $rh: $ratio );
$thm_w = round($ratio*$img_size[0]);
$thm_h = $thm_maxh;
}
$thm_src = $img_src;
if ( is_numeric($ratio) && $ratio<1 )
{
// use thumb, resize image
$thm_src = dirname($img_src)."/$thm_dir/".basename($img_src);
$thm_path = dirname($img_path)."/$thm_dir/".basename($img_path);
$flag_create = !file_exists($thm_path);
if ( !$flag_create )
{
$thm_size = getimagesize ( $thm_path );
if ( !$thm_size || $thm_size[0]!=$thm_w )
{
$flag_create = true;
}
}
if ( $flag_create )
{ // make thumb
if ( !file_exists(dirname($thm_path)) ) mkdir(dirname($thm_path),0777);
unset($i);
switch ( exif_imagetype($img_path) )
{
case IMAGETYPE_GIF:
$i = imagecreatefromgif($img_path);
break;
case IMAGETYPE_JPEG:
$i = imagecreatefromjpeg($img_path);
break;
case IMAGETYPE_PNG:
$i = imagecreatefrompng($img_path);
break;
case IMAGETYPE_BMP:
$i = imagecreatefromwbmp($img_path);
break;
case IMAGETYPE_SWF:
case IMAGETYPE_PSD:
case IMAGETYPE_TIFF_II:
case IMAGETYPE_TIFF_MM:
case IMAGETYPE_JPC:
case IMAGETYPE_JP2:
case IMAGETYPE_JPX:
case IMAGETYPE_SWC:
default:
$i = imagecreatefromxbm($fsrc);
} //detect image type
if ( $i )
{
$thm = imagecreatetruecolor($thm_w,$thm_h);
imagecolortransparent($thm,imagecolorat($i,0,0));
imagecopyresampled($thm,$i,0,0,0,0,$thm_w,$thm_h,$img_size[0],$img_size[1]) &&
imagejpeg($thm,$thm_path,$thm_qual);
imagedestroy($thm);
imagedestroy($i);
}
} // create thumb
} // $ratio<1
$img = sprintf('<img src="%s" border="0" %s>',$thm_src,$align);
$slf = "http://" . $_SERVER['HTTP_HOST'] . dirname($PHP_SELF) . "/";
if ( $img_lnk != "http://" && $img_lnk != $slf )
{
$img = sprintf('<a href="%s" target="%s">%s</a>',$img_lnk,$img_tgt,$img);
}
elseif ( $show_popup )
{
$img = sprintf('<a href="%s?img=%s" target="_blank">%s</a>',$viewer,urlencode($img_src),$img );
}
echo $img;
} // $img_src!=""
if ( $contenido || "CMS_IMGDESCR[15]" )
{
echo "<br>";
echo "CMS_IMGDESCR[15]";
}
if ( $contenido || "CMS_LINKDESCR[15]" )
{
echo "<br>";
echo "CMS_LINKDESCR[15]";
}
echo "<br>";
////siebentes Bild
$img_src = "CMS_IMG[16]"; // src of image
$img_lnk = "CMS_LINK[16]"; // image link
$img_tgt = "CMS_LINKTARGET[16]"; // target of imagelink
$img_path = str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $img_src);
if ( $img_src && file_exists($img_path) )
{
unset ($ratio);
$img_size = getimagesize ($img_path);
if ( $thm_maxw>0 )
{
$ratio = $thm_maxw/$img_size[0];
$thm_w = $thm_maxw;
$thm_h = round($ratio*$img_size[1]);
}
if ( $thm_maxh>0 )
{
$rh = $thm_maxh/$img_size[1];
$ratio = ( $ratio>$rh? $rh: $ratio );
$thm_w = round($ratio*$img_size[0]);
$thm_h = $thm_maxh;
}
$thm_src = $img_src;
if ( is_numeric($ratio) && $ratio<1 )
{
// use thumb, resize image
$thm_src = dirname($img_src)."/$thm_dir/".basename($img_src);
$thm_path = dirname($img_path)."/$thm_dir/".basename($img_path);
$flag_create = !file_exists($thm_path);
if ( !$flag_create )
{
$thm_size = getimagesize ( $thm_path );
if ( !$thm_size || $thm_size[0]!=$thm_w )
{
$flag_create = true;
}
}
if ( $flag_create )
{ // make thumb
if ( !file_exists(dirname($thm_path)) ) mkdir(dirname($thm_path),0777);
unset($i);
switch ( exif_imagetype($img_path) )
{
case IMAGETYPE_GIF:
$i = imagecreatefromgif($img_path);
break;
case IMAGETYPE_JPEG:
$i = imagecreatefromjpeg($img_path);
break;
case IMAGETYPE_PNG:
$i = imagecreatefrompng($img_path);
break;
case IMAGETYPE_BMP:
$i = imagecreatefromwbmp($img_path);
break;
case IMAGETYPE_SWF:
case IMAGETYPE_PSD:
case IMAGETYPE_TIFF_II:
case IMAGETYPE_TIFF_MM:
case IMAGETYPE_JPC:
case IMAGETYPE_JP2:
case IMAGETYPE_JPX:
case IMAGETYPE_SWC:
default:
$i = imagecreatefromxbm($fsrc);
} //detect image type
if ( $i )
{
$thm = imagecreatetruecolor($thm_w,$thm_h);
imagecolortransparent($thm,imagecolorat($i,0,0));
imagecopyresampled($thm,$i,0,0,0,0,$thm_w,$thm_h,$img_size[0],$img_size[1]) &&
imagejpeg($thm,$thm_path,$thm_qual);
imagedestroy($thm);
imagedestroy($i);
}
} // create thumb
} // $ratio<1
$img = sprintf('<img src="%s" border="0" %s>',$thm_src,$align);
$slf = "http://" . $_SERVER['HTTP_HOST'] . dirname($PHP_SELF) . "/";
if ( $img_lnk != "http://" && $img_lnk != $slf )
{
$img = sprintf('<a href="%s" target="%s">%s</a>',$img_lnk,$img_tgt,$img);
}
elseif ( $show_popup )
{
$img = sprintf('<a href="%s?img=%s" target="_blank">%s</a>',$viewer,urlencode($img_src),$img );
}
echo $img;
} // $img_src!=""
if ( $contenido || "CMS_IMGDESCR[16]" )
{
echo "<br>";
echo "CMS_IMGDESCR[16]";
}
if ( $contenido || "CMS_LINKDESCR[16]" )
{
echo "<br>";
echo "CMS_LINKDESCR[16]";
}
echo "<br>";
////zweites Bild
$img_src = "CMS_IMG[17]"; // src of image
$img_lnk = "CMS_LINK[17]"; // image link
$img_tgt = "CMS_LINKTARGET[17]"; // target of imagelink
$img_path = str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $img_src);
if ( $img_src && file_exists($img_path) )
{
unset ($ratio);
$img_size = getimagesize ($img_path);
if ( $thm_maxw>0 )
{
$ratio = $thm_maxw/$img_size[0];
$thm_w = $thm_maxw;
$thm_h = round($ratio*$img_size[1]);
}
if ( $thm_maxh>0 )
{
$rh = $thm_maxh/$img_size[1];
$ratio = ( $ratio>$rh? $rh: $ratio );
$thm_w = round($ratio*$img_size[0]);
$thm_h = $thm_maxh;
}
$thm_src = $img_src;
if ( is_numeric($ratio) && $ratio<1 )
{
// use thumb, resize image
$thm_src = dirname($img_src)."/$thm_dir/".basename($img_src);
$thm_path = dirname($img_path)."/$thm_dir/".basename($img_path);
$flag_create = !file_exists($thm_path);
if ( !$flag_create )
{
$thm_size = getimagesize ( $thm_path );
if ( !$thm_size || $thm_size[0]!=$thm_w )
{
$flag_create = true;
}
}
if ( $flag_create )
{ // make thumb
if ( !file_exists(dirname($thm_path)) ) mkdir(dirname($thm_path),0777);
unset($i);
switch ( exif_imagetype($img_path) )
{
case IMAGETYPE_GIF:
$i = imagecreatefromgif($img_path);
break;
case IMAGETYPE_JPEG:
$i = imagecreatefromjpeg($img_path);
break;
case IMAGETYPE_PNG:
$i = imagecreatefrompng($img_path);
break;
case IMAGETYPE_BMP:
$i = imagecreatefromwbmp($img_path);
break;
case IMAGETYPE_SWF:
case IMAGETYPE_PSD:
case IMAGETYPE_TIFF_II:
case IMAGETYPE_TIFF_MM:
case IMAGETYPE_JPC:
case IMAGETYPE_JP2:
case IMAGETYPE_JPX:
case IMAGETYPE_SWC:
default:
$i = imagecreatefromxbm($fsrc);
} //detect image type
if ( $i )
{
$thm = imagecreatetruecolor($thm_w,$thm_h);
imagecolortransparent($thm,imagecolorat($i,0,0));
imagecopyresampled($thm,$i,0,0,0,0,$thm_w,$thm_h,$img_size[0],$img_size[1]) &&
imagejpeg($thm,$thm_path,$thm_qual);
imagedestroy($thm);
imagedestroy($i);
}
} // create thumb
} // $ratio<1
$img = sprintf('<img src="%s" border="0" %s>',$thm_src,$align);
$slf = "http://" . $_SERVER['HTTP_HOST'] . dirname($PHP_SELF) . "/";
if ( $img_lnk != "http://" && $img_lnk != $slf )
{
$img = sprintf('<a href="%s" target="%s">%s</a>',$img_lnk,$img_tgt,$img);
}
elseif ( $show_popup )
{
$img = sprintf('<a href="%s?img=%s" target="_blank">%s</a>',$viewer,urlencode($img_src),$img );
}
echo $img;
} // $img_src!=""
if ( $contenido || "CMS_IMGDESCR[17]" )
{
echo "<br>";
echo "CMS_IMGDESCR[17]";
}
if ( $contenido || "CMS_LINKDESCR[17]" )
{
echo "<br>";
echo "CMS_LINKDESCR[17]";
}
echo "<br>";
?>
.. ich hoffe ich hab jetzt alles...