Hallo Armin,
meinst du dieses Modul?
Input:
Code: Alles auswählen
?><?php
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : Illustration
* Author(s) : Andreas Lindner, 4fb
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 12.08.2005
************************************************/
#Selected img directory
$cms_dirname = "CMS_VALUE[1]";
#Selected img
$cms_filename = "CMS_VALUE[2]";
if ($cms_dirname == '' || $cms_dirname == '0') {
$cms_dirname = 'bilder/';
}
#Get paths
$sql = "SELECT
htmlpath, frontendpath
FROM
".$cfg["tab"]["clients"]."
WHERE
idclient = ".$client." ";
$db->query($sql);
if ($db->next_record()) {
$htmlpath = $db->f('htmlpath');
$frontendpath = $db->f('frontendpath');
}
#Choose image folder
echo '<table cellpadding="0" cellspacing="0" border="0">
<tr><td class="text_medium" style="padding:5px">'.mi18n("The image should have these dimensions: 170 x 80px").'</td></tr>
<tr><td class="text_medium" style="padding:5px">'.mi18n("Choose image directory").': </td></tr>
<tr><td class="text_medium" style="padding:5px">';
echo '<select name="CMS_VAR[1]" style="width:200px">';
#Get upload directories
$sql = "SELECT DISTINCT
dirname
FROM
".$cfg["tab"]["upl"]."
WHERE
idclient='$client' AND
filetype IN ('jpeg','jpg','gif','png')
ORDER BY
dirname";
$db->query($sql);
$selected = false;
while ($db->next_record()) {
$dirname = $db->f('dirname');
if ($cms_dirname != $dirname) {
echo '<option value="'.$dirname.'"> '.$dirname.'</option>';
} else {
$selected = true;
echo '<option value="'.$dirname.'" selected="selected"> '.$dirname.'</option>';
}
}
if (!$selected) {
echo '<option value="0" selected="selected">'.i18n("Please choose").'</option>';
} else {
echo '<option value="0">'.i18n("Please choose").'</option>';
}
#Choose image file
echo '</select> <input type="image" src="images/submit.gif">
<tr><td class="text_medium" style="padding:5px">'.mi18n("Choose image").': </td></tr>
<tr><td class="text_medium" style="padding:5px">';
echo '<select name="CMS_VAR[2]" style="width:200px">';
echo '<option value="0" selected="selected">'.mi18n("Please choose").'</option>';
if ($cms_dirname != '0') {
#Get uploaded files
$sql = "SELECT
filename
FROM
".$cfg["tab"]["upl"]."
WHERE
idclient = '$client' AND
filetype IN ('jpeg','jpg','gif','png','swf') AND
dirname = '$cms_dirname'
ORDER BY
filename";
$db->query($sql);
while ($db->next_record()) {
$img_name = $db->f('filename');
if ($cms_filename != $img_name) {
echo '<option value="'.$img_name.'"> '.$img_name.'</option>';
} else {
echo '<option selected="selected" value="'.$img_name.'"> '.$img_name.'</option>';
}
}
}
echo '</select> <input type="image" src="images/submit.gif">';
#Preview image
if ($cms_dirname != '0' && $cms_filename != '0' && strlen($cms_dirname) > 0 && strlen($cms_filename) > 0) {
$img_path = $htmlpath.$cfgClient[$client]['upload'].$cms_dirname.$cms_filename;
$img_split = preg_split("/\./", $cms_filename);
$count = count($img_split);
$type = $img_split[$count -1];
echo '<tr><td colspan="2" style="padding:5px">
<img src="'.$img_path.'">
</td></tr> ';
}
echo '</td></tr>';
echo '</table>';
?><?php
Output:
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Illustration
* Author(s) : Andreas Lindner, 4fb
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 12.08.2005
************************************************/
#Selected img directory
$cms_dirname = "CMS_VALUE[1]";
#Selected img
$cms_filename = "CMS_VALUE[2]";
#Default settings
$img_width = 170;
$img_height = 80;
$defaultImage = 'bilder/illu.jpg';
$htmlpath = $cfgClient[$client]['path']['htmlpath'];
$frontendpath = $cfgClient[$client]['path']['frontend'];
$img_path = $htmlpath.$cfgClient[$client]['upload'].$defaultImage;
$img_path_fs = $frontendpath.$cfgClient[$client]['upload'].$defaultImage;
#Check configured images
if ($cms_dirname != '0' && $cms_filename != '0' && strlen($cms_dirname) > 0 && strlen($cms_filename) > 0) {
$img_path = $htmlpath.$cfgClient[$client]['upload'].$cms_dirname.$cms_filename;
$img_path_fs = $frontendpath.$cfgClient[$client]['upload'].$cms_dirname.$cms_filename;
$img_split = preg_split("/\./", $cms_filename);
$count = count($img_split);
$type = $img_split[$count -1];
if (!file_exists($img_path_fs)) {
$img_path = $htmlpath.$cfgClient[$client]['upload'].$defaultImage;
$img_path_fs = $frontendpath.$cfgClient[$client]['upload'].$defaultImage;
}
}
#Scale image
$image = capiImgScale($img_path_fs, $img_width, $img_height, false, false, 10, false);
#Get dimensions of scaled image
list ($width, $height, $type, $attr) = getimagesize(str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $image));
#Output header with logo and illustration
echo " <div id=\"header\"><p style=\"background-image: url(".$image.");\"><a href=\"front_content.php\"><img src=\"images/logo.gif\" alt=\"".mi18n("Logo")."\" title=\"".mi18n("Back to home")."\"/></a></p></div>";
?>
Gruß aus Franken
Ortwin