Ich will, dass die beiden Bilder perDefault vorbelegt sind und eben nur optional geändert werden können...

Das Modul heist bei mir "Bild (1)"mvf hat geschrieben:welches modul verwendest du für die bilder?
das modul 'Illustration' aus der standard 4.6.4? und nur sicherheisthalber, im template 'vorkonfiguration' ist es konfiguriert, der tab neben visuelles editieren?
Code: Alles auswählen
<?php
if ("CMS_IMG[1]" != "") {
$img = '<img src="CMS_IMG[1]" border="0">';
if ("CMS_LINK[2]" != "http://") {
$img = sprintf('<a href="%s" target="%s">%s</a>',"CMS_LINK[1]", "CMS_LINKTARGET[1]", $img);
}
echo $img;
}
echo "<br>";
echo "CMS_IMGDESCR[1]";
echo "<br>";
echo "CMS_LINKDESCR[1]";
echo "<br>";
?>
wie bereits beschrieben, eine standard installation mit beispielmandanten und inhalten anlegen als referenz, da wird das modul illustration genutzt, versuch des zunächst für eine seite, bin mir nicht sicher ob man des mehrfach einsetzen kann ohne modifikation.FriFra hat geschrieben:Das Modul heist bei mir "Bild (1)"![]()
wäre mir neu aber ich lasse mich gerne belehren.FriFra hat geschrieben:Das Modul IST eine Kopie den entspr. Moduls des Beispielmandanten...
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("Das Bild soll folgende Größe haben: 170 x 80 px").'</td></tr>
<tr><td class="text_medium" style="padding:5px">'.mi18n("Bildverzeichnis wählen").': </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("Bitte wählen").'</option>';
} else {
echo '<option value="0">'.i18n("Bitte wählen").'</option>';
}
#Choose image file
echo '</select> <input type="image" src="images/submit.gif">
<tr><td class="text_medium" style="padding:5px">'.mi18n("Bild wählen").': </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">'.i18n("Bitte wählen").'</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' AND $cms_filename != '0' AND strlen($cms_dirname) > 0 AND 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
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' AND $cms_filename != '0' AND strlen($cms_dirname) > 0 AND 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($image);
#Output image tag
echo '<img src="'.$image.'" width="'.$width.'" height="'.$height.'" alt="'.mi18n("Illustration").'" title="'.mi18n("Illustration").'"/>';
?>