Ich habe mir beim Einsatz des folgenden Fließtextmoduls einige Gedanken um eventuelle Erweiterungen gemacht:
Erstmal das Modul an sich:
Eingabe:
Code: Alles auswählen
echo "<table align=\"left\" cellpadding=\"0\" cellspacing=\"0\">
<tr valign=\"top\">
<td width=\"202\">Modul anzeigen?</td>
<td><select name=\"CMS_VAR[3]\" size=\"1\">";
if ("CMS_VALUE[3]" == "") {
echo "<option selected>Ja</option>";
echo "<option>Nein</option>";
}
if ("CMS_VALUE[3]" != "") {
echo "<option selected>CMS_VALUE[3]</option>";
echo "<option>Ja</option>";
echo "<option>Nein</option>";
}
echo"
</tr><tr valign=\"top\">
<td width=\"202\">Bildposition</td>
<td><select name=\"CMS_VAR[4]\" size=\"1\">";
if ("CMS_VALUE[4]" == "") {
echo "<option selected>Links</option>";
echo "<option>Rechts</option>";
}
if ("CMS_VALUE[4]" != "") {
echo "<option selected>CMS_VALUE[4]</option>";
echo "<option>Links</option>";
echo "<option>Rechts</option>";
}
//Skalierung
echo"
</tr><tr valign=\"top\">
<td width=\"202\">Skalierung (% der zulässigen Breite von 200)</td>
<td><select name=\"CMS_VAR[5]\" size=\"1\">";
if ("CMS_VALUE[5]" == "") {
echo "<option selected>keine Skalierung</option>";
}
if ("CMS_VALUE[5]" != ""){
if("$CMS_VALUE[5]" =="keine Skalierung")
echo "<option selected>keine Skalierung</option>";
echo "<option selected>CMS_VALUE[5]</option>";
}
echo "<option>keine Skalierung</option>";
for ($i=10; $i<=100;$i+=10){
echo "<option";
if ("$CMS_VALUE[5]" ==$i)echo "selected";
echo ">".$i." %</option>";
}
echo"</select></td>"; //ende skalierung
echo"
</tr><tr valign=\"top\">
<td width=\"202\">".$mod["font"]." Fliesstext:</td>
<td><select name=\"CMS_VAR[0]\" size=\"1\">";
if ("CMS_VALUE[0]" == 0) {
echo "<option value=\"3\" selected>Font 3: Flie�ext</option>";
}
for ($i=1; $i<7; $i++) {
if ($i != "CMS_VALUE[0]") {
echo "<option value=\"$i\">Font $i</option>";
} else {
echo "<option value=\"$i\" selected>Font $i</option>";
}
}
echo "</SELECT></td>
</tr><tr valign=\"top\">
<td width=\"202\">".$mod["font"]." Beschreibung:</td>
<td><select name=\"CMS_VAR[1]\" size=\"1\">";
if ("CMS_VALUE[1]" == 0) {
echo "<option value=\"4\">Font 4: Text klein</option>";
}
for ($i=1; $i<7; $i++) {
if ($i != "CMS_VALUE[1]") {
echo "<option value=\"$i\">Font $i</option>";
} else {
echo "<option value=\"$i\" selected>Font $i</option>";
}
}
echo "</SELECT></td></tr></table>
<input type=\"hidden\" name=\"CMS_VAR[2]\" value=\"".$value."\">";
Code: Alles auswählen
<?php
$image_width_max=200;
$tmp_img1 = "CMS_IMG[1CMS_VALUE[2]]";
$fileid = "CMS_IMG[1CMS_VALUE[2]]";
$tmpImgDescr1 = "CMS_IMGDESCR[1CMS_VALUE[2]]";
if ("CMS_VALUE[3]" != "Nein") { //check ob Modulanzeige Ja / Nein
if ($tmp_img1){// Begin Bildroessencheck, wenn ein Bild vorhanden
$original_size=GetImageSize($tmp_img1); //holt die Bildgroessen aus dem Originalbild
if ("CMS_VALUE[5]"=="keine Skalierung"){ //begin keine skalierung
if($original_size[0]<=$image_width_max){
$new_size="height=\"".$original_size[1]."\" width=\"".$original_size[0]."\"";
}
if($original_size[0]>$image_width_max){
$new_image_height=(int)($image_width_max*$original_size[1]/$original_size[0]);
$new_size="height=\"".$new_image_height."\" width=\"".$image_width_max."\"";
}
}//end keine Skalierung
if (ereg(" %","CMS_VALUE[5]")){ //begin Skalierung mit Prozent
$skal_proz=split(" ","CMS_VALUE[5]");
$skal_faktor=$skal_proz[0]/100;
$new_image_width=(int)($image_width_max*$skal_faktor);
$new_image_height=(int)($new_image_width*$original_size[1]/$original_size[0]);
$new_size="height=\"".$new_image_height."\" width=\"".$new_image_width."\"";
} //end Skalierung mit Prozent
} // Ende Bildgroesssencheck
if("CMS_VALUE[4]" == "Rechts") { //Ausgabe Bild Rechts
echo "<table width=100% border=0><tr><td align=left>";
if(($tmp_img1)||($tmpImgDescr1!=""))
echo "<div style=\"float:right; text-align:left; margin-left:10px; margin-bottom:10px \">";
if ($tmp_img1) {echo "<A class=\"images\" HREF=\"thumb2.php?url=".$fileid."\" target=\"full\">
<IMG SRC=\"CMS_IMG[1CMS_VALUE[2]]\" ";
if($new_size!="")echo $new_size;
if($edit != "true"){echo " title=\"CMS_IMGDESCR[1CMS_VALUE[2]] (Klicken für Vollansicht)\"
alt=\"CMS_IMGDESCR[1CMS_VALUE[2]]\"></a>";}
else {echo ">";};
};
if ($tmpImgDescr1 !="") {
echo ("<br><center>CMS_IMGDESCR[1CMS_VALUE[2]]</center>");
}
else {
echo "CMS_IMGDESCR[1CMS_VALUE[2]]";
}
if(($tmp_img1)||($tmpImgDescr1!=""))
echo "</div>";
echo "<p>CMS_TEXT[1CMS_VALUE[2]]<br style=clear:all></p>";
echo "</td></tr></table>";
} // Ende Ausgabe Bild Rechts
if("CMS_VALUE[4]" != "Rechts") { //Ausgabe Bild Links
echo "<table width=100% border=0><tr><td align=left>";
if(($tmp_img1)||($tmpImgDescr1!=""))
echo "<div style=\"float:left; text-align:left; margin-right:10px; margin-bottom:10px \">";
if ($tmp_img1) {echo "<A class=\"images\" HREF=\"thumb2.php?url=".$fileid."\" target=\"full\">
<IMG SRC=\"CMS_IMG[1CMS_VALUE[2]]\" ";
if($new_size!="")echo $new_size;
if($edit != "true"){echo " title=\"CMS_IMGDESCR[1CMS_VALUE[2]] (Klicken für Vollansicht)\"
alt=\"CMS_IMGDESCR[1CMS_VALUE[2]]\"></a>";}
else {echo ">";};
};
if ($tmpImgDescr1 !="") {
echo ("<br> <center>CMS_IMGDESCR[1CMS_VALUE[2]]</center>");
}
else {
echo "CMS_IMGDESCR[1CMS_VALUE[2]]";
}
if(($tmp_img1)||($tmpImgDescr1!=""))
echo "</div>";
echo "<p>CMS_TEXT[1CMS_VALUE[2]]<br></p>";
echo "</td></tr></table>";
} // Ende Ausgabe Bild Links
} // Ende if Modulanzeige ja/nein
?>
Dennoch stelle ich mir noch folgende Fragen zur erweiterung:
1. Ist es möglich mehrere Bilder und damit natürlich auch Texte in einem Fließtextmodul unterzubringen, ich habe mir das etwa so vorgestellt: Das erste Bild steht links, das zweite recht, das dritte wieder links, usw.
Die Alternative mit mehreren Fließtextmodulen in einem Template funktioniert nicht.
2. Das jeweilige Bild wird ja nicht wirklich verkleinert, demnach müsste ich noch eine Thumbnail-Funktionalität integrieren.
Ein paar Anregungen wären hilfreich.
Danke schon im Voraus...
Kasi[/code]