Bild mit Thumb will nicht mehr
Verfasst: Mi 4. Okt 2006, 12:22
Hallo,
nach meinem teilweisen Erfolg beim Serverumzug funktioniert das Modul Bild mit Thumb von Gerhard Müller (erweitert auf 5 Bilder von mir) nicht mehr. Ich kann zwar im Editor das Bild ansehen und aussuchen- und er merkt sich auch welches ich gewählt habe - aber es wird weder in der Vorschau noch im backend angezeigt.
Alles Andere scheint zu funktionieren, auch das Einfügen von Bildern im Text/Html.
Hier nochmal der Code des Modules:
Rechte für den viewer und thumb- Verzeichnisse sind 777 vergeben.
De contenido-Ordner und der Mandanten-Ordner liegen beide in einem Ordner contenidocms.
Auf dem alten Server funktioniert alles.
Habt ihr einen Tip??
jacke
nach meinem teilweisen Erfolg beim Serverumzug funktioniert das Modul Bild mit Thumb von Gerhard Müller (erweitert auf 5 Bilder von mir) nicht mehr. Ich kann zwar im Editor das Bild ansehen und aussuchen- und er merkt sich auch welches ich gewählt habe - aber es wird weder in der Vorschau noch im backend angezeigt.
Alles Andere scheint zu funktionieren, auch das Einfügen von Bildern im Text/Html.
Hier nochmal der Code des Modules:
Code: Alles auswählen
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : Bild mit Thumb
* Author : Gerhard Müller
* Copyright : MKO
* Created : 4.3.2005
* Version : $Id$
* Modified : $Date$
************************************************/
if ( "CMS_VALUE[5]" )
{
$thm_dir="CMS_VALUE[5]";
}
else
{
$thm_dir = defined(THUMB_DIR)? THUMB_DIR: "thumb"; // thumb dir - default "thm"
}
echo '<table cellspacing="0" cellpadding="10" border="0">';
echo '<tr><td>Thumb Verzeichnis (optional):</td>';
echo '<td><input type="text" name="CMS_VAR[5]" value="CMS_VALUE[5]" size="30" /></td></tr>';
echo '<tr><td>Maximale Breite Thumbs:</td>';
echo '<td><input type="text" name="CMS_VAR[6]" value="CMS_VALUE[6]" size="4" />px</td></tr>';
echo '<tr><td>Maximale Höhe Thumbs:</td>';
echo '<td><input type="text" name="CMS_VAR[7]" value="CMS_VALUE[7]" size="4" />px</td></tr>';
echo '<tr><td>Qualität Thumbs (optional):</td>';
echo '<td><input type="text" name="CMS_VAR[9]" value="CMS_VALUE[9]" size="3" />%</td></tr>';
$align = "CMS_VALUE[10]";
$opts = array ( "","absbottom","absmiddle","baseline","bottom","left","middle","right","texttop","top" );
echo '<tr><td>Ausrichtung Thumb (optional):</td>';
echo '<td><select name="CMS_VAR[10]">';
foreach ( $opts as $v )
{
$sel = ( $align==$v? "selected": "" );
echo "<option value=\"$v\" $sel>$v</option>";
}
echo '</select></td></tr>';
echo "<tr><td>Popup aktivieren:</td>";
$pop = "CMS_VALUE[8]";
$chk = ( $pop>""? "checked": "" );
echo '<td><input type="checkbox" name="CMS_VAR[8]" value="true" size="3" '.$chk.' /></td></tr>';
echo "</table>";
Code: Alles auswählen
<?php
$viewer = "/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_dir = $cfg['path']['frontend']; // base dir frontend
$img_src = "CMS_IMG[10]"; // src of image
$img_lnk = "CMS_LINK[10]"; // image link
$img_tgt = "CMS_LINKTARGET[10]"; // target of imagelink
$img_url = parse_url($img_src);
$img_path = "$img_dir".$img_url['path'];
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_dir = $cfg['path']['frontend']; // base dir frontend
$img_src = "CMS_IMG[11]"; // src of image
$img_lnk = "CMS_LINK[11]"; // image link
$img_tgt = "CMS_LINKTARGET[11]"; // target of imagelink
$img_url = parse_url($img_src);
$img_path = "$img_dir".$img_url['path'];
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_dir = $cfg['path']['frontend']; // base dir frontend
$img_src = "CMS_IMG[12]"; // src of image
$img_lnk = "CMS_LINK[12]"; // image link
$img_tgt = "CMS_LINKTARGET[12]"; // target of imagelink
$img_url = parse_url($img_src);
$img_path = "$img_dir".$img_url['path'];
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_dir = $cfg['path']['frontend']; // base dir frontend
$img_src = "CMS_IMG[13]"; // src of image
$img_lnk = "CMS_LINK[13]"; // image link
$img_tgt = "CMS_LINKTARGET[13]"; // target of imagelink
$img_url = parse_url($img_src);
$img_path = "$img_dir".$img_url['path'];
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_dir = $cfg['path']['frontend']; // base dir frontend
$img_src = "CMS_IMG[14]"; // src of image
$img_lnk = "CMS_LINK[14]"; // image link
$img_tgt = "CMS_LINKTARGET[14]"; // target of imagelink
$img_url = parse_url($img_src);
$img_path = "$img_dir".$img_url['path'];
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>";
?>
De contenido-Ordner und der Mandanten-Ordner liegen beide in einem Ordner contenidocms.
Auf dem alten Server funktioniert alles.
Habt ihr einen Tip??
jacke