leider keine Zeit, aber trotzdem das Ergebnis meiner tagelangen Arbeit hier für Euch. Eine Überarbeitung des Start-Artikelliste Gold Moduls.
Code: Alles auswählen
Name des Moduls: START-ARTIKEL-LISTE (Platinum)
Beschreibung: Listet frei wählbare Überschriften, Texte und Bilder aus dem Modul "DER ARTIKEL" als Vorschau auf.
Die Nummer des Containers, in dem sich das Modul "DER ARTIKEL" befindet ist wählbar (war bisher nur im Modul-Output konfigurierbar).
Es können Startartikel von Kategorien oder die Artikel einer Kategorie gewählt und angezeigt werden.
Die Länge der Vorschautexte und die Schriftart der Fonts sind frei wählbar.
Vorschaubildgröße ist ist in der Breite wählbar, das Bild wird dann skaliert.
Die Bildposition links/rechts ist wählbar.
Die Anzeige eines Trenners wählbar.
MipForms 1.2 und Modul "DER ARTIKEL" (1.0.3) werden benötigt.
// Contenido 4.2
// MODUL-INPUT: Artikelliste (Platinum)
// Autor: HardCastle
// Veröffentlichung: Contenido-Forum
// Danke an die Autoren der ursprünglichen Moduls Artikelliste und an JSIT für das Modul Start-Artikelliste Gold, dass als
// Vorlage für diese Weiterentwicklung diente.
//-------------------------------
// KONFIGURATION
//-------------------------------
//CSS Style 'class_only', wenn ihr Klassen benutzen wollt
// 'id_only', wenn ihr css- Id's benutzen wollt
//Achtet darauf, dass ihr dies auch im output nocheinmal
//konfigurieren muesst, wenn ihr die Voreinstellung
//von 'class_only' auf 'id_only' aendert.
$css_style = 'id_only';
//-------------------------------
// ENDE DER KONFIGURATION
//-------------------------------
require_once ($ContenidoPath ."inc/fnc_mip_forms.inc.php");
//Modul an / aus
$mip_form['0']['cat'] = 'option';
$mip_form['0']['type'] = '';
$mip_form['0']['desc'] = 'Modul an/aus:';
$mip_form['0']['cms_var'] = 'CMS_VAR[0]';
$mip_form['0']['cms_val'] = 'CMS_VALUE[0]';
$mip_form['0']['option_desc']['0'] = 'Modul aktiviert';
$mip_form['0']['option_val']['0'] = 'true';
$mip_form['0']['option_desc']['1'] = 'Modul deaktiviert';
$mip_form['0']['option_val']['1'] = 'false';
$mip_form['0']['tab'] = '0';
//Kategorie wählen
$mip_form['1']['desc'] = 'Welche Kategorie?';
$mip_form['1']['cat'] = 'app_cat';
$mip_form['1']['output_cat'] = 'option';
$mip_form['1']['cms_var'] = "CMS_VAR[1]";
$mip_form['1']['cms_val'] = "CMS_VALUE[1]";
//Artikelliste oder Startartikel
$mip_form['2']['desc'] = 'Art der Anzeige:';
$mip_form['2']['cat'] = 'option';
$mip_form['2']['type'] = '';
$mip_form['2']['cms_var'] = 'CMS_VAR[2]';
$mip_form['2']['cms_val'] = 'CMS_VALUE[2]';
$mip_form['6']['cms_val_default'] = '0';
$mip_form['2']['option_desc']['0'] = 'ARTIKEL';
$mip_form['2']['option_val']['0'] = '0';
$mip_form['2']['option_desc']['1'] = 'STARTSEITEN';
$mip_form['2']['option_val']['1'] = '1';
$mip_form['2']['tab'] = '0';
//Schriftart Head1
$mip_form['3']['desc'] = 'Schriftart der Überschrift (Link):';
$mip_form['3']['cat'] = 'app_css';
$mip_form['3']['output_cat'] = 'option';
$mip_form['3']['type'] = '';
$mip_form['3']['cms_var'] = 'CMS_VAR[3]';
$mip_form['3']['cms_val'] = 'CMS_VALUE[3]';
$mip_form['3']['flag'] = $css_style;
//Schriftart Text1
$mip_form['4']['desc'] = 'Schriftart des Einführungstextes:';
$mip_form['4']['cat'] = 'app_css';
$mip_form['4']['output_cat'] = 'option';
$mip_form['4']['type'] = '';
$mip_form['4']['cms_var'] = 'CMS_VAR[4]';
$mip_form['4']['cms_val'] = 'CMS_VALUE[4]';
$mip_form['4']['flag'] = $css_style;
//Max. Zeichen Ueberschrift1
$mip_form['5']['cat'] = 'txt';
$mip_form['5']['type'] = '';
$mip_form['5']['desc'] = 'Zeichenlänge Überschrift:';
$mip_form['5']['cms_var'] = 'CMS_VAR[5]';
$mip_form['5']['cms_val'] = 'CMS_VALUE[5]';
$mip_form['5']['cms_val_default'] = '100';
$mip_form['5']['tab'] = '0';
//Bildbreite
$mip_form['6']['cat'] = 'txt';
$mip_form['6']['type'] = '';
$mip_form['6']['desc'] = 'Bildbreite (Pixel):';
$mip_form['6']['cms_var'] = 'CMS_VAR[6]';
$mip_form['6']['cms_val'] = 'CMS_VALUE[6]';
$mip_form['6']['cms_val_default'] = '50';
$mip_form['6']['tab'] = '0';
//Bildhöhe ist wegen Skalierungsfunktion weggefallen
//Text für Weiterleitungslink
$mip_form['8']['cat'] = 'txt';
$mip_form['8']['type'] = '';
$mip_form['8']['desc'] = 'Text für Weiterleitung:';
$mip_form['8']['cms_var'] = 'CMS_VAR[8]';
$mip_form['8']['cms_val'] = 'CMS_VALUE[8]';
$mip_form['8']['cms_val_default'] = '';
$mip_form['8']['tab'] = '0';
//Max. Zeichen Text
$mip_form['9']['cat'] = 'txt';
$mip_form['9']['type'] = '';
$mip_form['9']['desc'] = 'Zeichenlänge Einführungstextes:';
$mip_form['9']['cms_var'] = 'CMS_VAR[9]';
$mip_form['9']['cms_val'] = 'CMS_VALUE[9]';
$mip_form['9']['cms_val_default'] = '100';
$mip_form['9']['tab'] = '0';
//Container-Nr. DER ARTIKEL
$mip_form['10']['cat'] = 'txt';
$mip_form['10']['type'] = '';
$mip_form['10']['desc'] = 'Container-Nr. von DER ARTIKEL:';
$mip_form['10']['cms_var'] = 'CMS_VAR[10]';
$mip_form['10']['cms_val'] = 'CMS_VALUE[10]';
$mip_form['10']['cms_val_default'] = '';
$mip_form['10']['tab'] = '0';
//Trenner an / aus
$mip_form['12']['cat'] = 'option';
$mip_form['12']['type'] = '';
$mip_form['12']['desc'] = 'Trennlinie an/aus:';
$mip_form['12']['cms_var'] = 'CMS_VAR[12]';
$mip_form['12']['cms_val'] = 'CMS_VALUE[12]';
$mip_form['12']['option_desc']['0'] = 'Trennlinie an';
$mip_form['12']['option_val']['0'] = 'true';
$mip_form['12']['option_desc']['1'] = 'Trennlinie aus';
$mip_form['12']['option_val']['1'] = 'false';
$mip_form['12']['tab'] = '0';
//Was soll 1. angezeigt werden
$mip_form['13']['desc'] = 'Welche Überschrift (Link)?';
$mip_form['13']['cat'] = 'option';
$mip_form['13']['type'] = '';
$mip_form['13']['cms_var'] = 'CMS_VAR[13]';
$mip_form['13']['cms_val'] = 'CMS_VALUE[13]';
$mip_form['13']['cms_val_default'] = 'u1';
$mip_form['13']['option_desc']['0'] = 'Überschrift 1';
$mip_form['13']['option_val']['0'] = 'u1';
$mip_form['13']['option_desc']['1'] = 'Überschrift 2';
$mip_form['13']['option_val']['1'] = 'u2';
$mip_form['13']['option_desc']['2'] = 'Text 1';
$mip_form['13']['option_val']['2'] = 't1';
$mip_form['13']['option_desc']['3'] = 'Text 2';
$mip_form['13']['option_val']['3'] = 't2';
$mip_form['13']['tab'] = '0';
//Was soll 2. angezeigt werden
$mip_form['14']['desc'] = 'Welcher Einführungstext?';
$mip_form['14']['cat'] = 'option';
$mip_form['14']['type'] = '';
$mip_form['14']['cms_var'] = 'CMS_VAR[14]';
$mip_form['14']['cms_val'] = 'CMS_VALUE[14]';
$mip_form['14']['cms_val_default'] = 't1';
$mip_form['14']['option_desc']['0'] = 'Überschrift 1';
$mip_form['14']['option_val']['0'] = 'u1';
$mip_form['14']['option_desc']['1'] = 'Überschrift 2';
$mip_form['14']['option_val']['1'] = 'u2';
$mip_form['14']['option_desc']['2'] = 'Text 1';
$mip_form['14']['option_val']['2'] = 't1';
$mip_form['14']['option_desc']['3'] = 'Text 2';
$mip_form['14']['option_val']['3'] = 't2';
$mip_form['14']['tab'] = '0';
//Welches Bild soll angezeigt werden?
$mip_form['15']['desc'] = 'Welches Bild?';
$mip_form['15']['cat'] = 'option';
$mip_form['15']['type'] = '';
$mip_form['15']['cms_var'] = 'CMS_VAR[15]';
$mip_form['15']['cms_val'] = 'CMS_VALUE[15]';
$mip_form['15']['cms_val_default'] = '1';
$mip_form['15']['option_desc']['0'] = 'Bild 1';
$mip_form['15']['option_val']['0'] = '1';
$mip_form['15']['option_desc']['1'] = 'Bild 2';
$mip_form['15']['option_val']['1'] = '2';
$mip_form['15']['option_desc']['2'] = 'Bild 3';
$mip_form['15']['option_val']['2'] = '3';
$mip_form['15']['tab'] = '0';
//Bildposition links oder rechts?
$mip_form['16']['desc'] = 'Bildposition:';
$mip_form['16']['cat'] = 'option';
$mip_form['16']['type'] = '';
$mip_form['16']['cms_var'] = 'CMS_VAR[16]';
$mip_form['16']['cms_val'] = 'CMS_VALUE[16]';
$mip_form['16']['cms_val_default'] = 'left';
$mip_form['16']['option_desc']['0'] = 'links';
$mip_form['16']['option_val']['0'] = 'left';
$mip_form['16']['option_desc']['1'] = 'rechts';
$mip_form['16']['option_val']['1'] = 'right';
$mip_form['16']['tab'] = '0';
//Abstand zwischen Bild und Text
$mip_form['17']['cat'] = 'txt';
$mip_form['17']['type'] = '';
$mip_form['17']['desc'] = 'Abstand Bild - Text:';
$mip_form['17']['cms_var'] = 'CMS_VAR[17]';
$mip_form['17']['cms_val'] = 'CMS_VALUE[17]';
$mip_form['17']['cms_val_default'] = '5';
$mip_form['17']['tab'] = '0';
//HTML-Template für Trenner
$mip_form['18']['cat'] = 'txtarea';
$mip_form['18']['rows'] = '3';
$mip_form['18']['type'] = '';
$mip_form['18']['desc'] = 'HTML-Template Trenner:';
$mip_form['18']['cms_var'] = 'CMS_VAR[18]';
$mip_form['18']['cms_val'] = 'CMS_VALUE[18]';
$mip_form['18']['cms_val_default'] = '<hr>';
$mip_form['18']['tab'] = '0';
mip_formsp($mip_form['0']);
mip_formsp($mip_form['2']);
mip_formsp($mip_form['1']);
echo "<hr>";
mip_formsp($mip_form['10']);
mip_formsp($mip_form['13']);
mip_formsp($mip_form['5']);
mip_formsp($mip_form['3']);
mip_formsp($mip_form['14']);
mip_formsp($mip_form['9']);
mip_formsp($mip_form['4']);
mip_formsp($mip_form['15']);
mip_formsp($mip_form['6']);
mip_formsp($mip_form['16']);
mip_formsp($mip_form['17']);
echo "<hr>";
mip_formsp($mip_form['8']);
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
<tr valign=\"top\">
<td width=\"202\">Bild für Weiterleitung:</td>
<td width=\"135\"><select name=\"CMS_VAR[11]\" size=\"1\" style=\"width:100%\">";
$sql = "SELECT * FROM $cfgTab_upl WHERE idclient='$client' AND filetype='img' ORDER BY filename";
$db->query($sql);
while ($db->next_record()) {
echo "<option value=\"".$db->f("filename")."\" selected>".$db->f("description")."</option>";
}
echo "</SELECT></td>
<td width=\"5\"> </td></tr>
</table>";
mip_formsp($mip_form['12']);
mip_formsp($mip_form['18']);
unset($mip_form);
// Contenido 4.2
// MODUL-OUTPUT: Artikelliste (Platinum)
// Autor: HardCastle
// Veröffentlichung: Contenido-Forum
// Danke an die Autoren der ursprünglichen Moduls Artikelliste und an JSIT für das Modul Start-Artikelliste Gold, dass als
// Vorlage für diese Weiterentwicklung diente.
//-------------------------------
// KONFIGURATION
//-------------------------------
// CSS- STYLE SHEETS
// Welche styles sollen benutzt werden? Mögliche Werte sind
// 'id' oder 'class'
// WICHTIG:
// Wird 'id' gewählt, muß im Inputbereich 'id_only' gewählt werden
// Wird 'class' gewählt, muß im Inputbereich 'class_only' gewählt werden
$css_style = 'id';
//-------------------------------
// ENDE DER KONFIGURATION
//-------------------------------
//Abstand zwischen Bild und Text in Pixeln
$imgspace = "CMS_VALUE[17]";
//Trenner zwischen den Vorschauen
$trennerhtml = "CMS_VALUE[18]";
// second db class instance
$db2 = new DB_Contenido;
// Modul an/aus
$mod_active = "CMS_VALUE[0]";
//Container-Nr.
$contain = "CMS_VALUE[10]";
//Überschrift-Link
$ueberschrift = "CMS_VALUE[13]";
//Einführungstext
$einfuehrung = "CMS_VALUE[14]";
//Bild-Nr.
$bildnr = "CMS_VALUE[15]";
// selected category
$selcat = "CMS_VALUE[1]";
// selected is_start article or site article
$sel_start = "CMS_VALUE[2]";
// Schriftart Ueberschrift
$fonthead = "CMS_VALUE[3]";
// Schriftart Text
$fonttext = "CMS_VALUE[4]";
// Anzahl der Zeichen Ueberschrift1
$mxh[0] = "CMS_VALUE[5]";
// Anzahl der zeichen Text1
$mxh[1] = "CMS_VALUE[9]";
// bildgröße
$imgwidth = "CMS_VALUE[6]"; // Breite des verkleinerten Bildes
$imgwidth = floor ($imgwidth); // ganze positive Zahl
//Bildposition
$imgposition = "CMS_VALUE[16]";
// selected 'Weiter' Text
$text_to = "CMS_VALUE[8]";
// selected 'Weiter' Bild
$image_to = "CMS_VALUE[11]";
//Trennlinie
$trenner = "CMS_VALUE[12]";
if ($trenner == 'true') {$trenner = $trennerhtml;} else {$trenner = "";};
//Modul an?
if($mod_active == 'true'){
// select all articles in category widthout start article
// jsit start
if ($sel_start=="0") {
$query = "SELECT ARTLANG.idside, ARTLANG.idsidelang FROM $cfgTab_cat_side AS CATART, $cfgTab_side_lang AS ARTLANG "."WHERE CATART.idcat = '$selcat' AND ARTLANG.idside = CATART.idside AND ARTLANG.idlang = '$lang' AND "."ARTLANG.online = '1' AND CATART.is_start = '0' ORDER BY ARTLANG.title";
}
else
{
$query = "SELECT ARTLANG.idside, ARTLANG.idsidelang, CATART.idcat FROM $cfgTab_cat_side AS CATART, $cfgTab_side_lang AS ARTLANG, $cfgTab_cat AS KAT "."WHERE KAT.parentid = '$selcat' AND CATART.idcat = KAT.idcat AND ARTLANG.idside = CATART.idside AND ARTLANG.idlang = '$lang' AND "."ARTLANG.online = '1' AND CATART.is_start = '1 ' ORDER BY ARTLANG.title";
}
//jsit end
// execute query
$db->query($query);
IF (_DEBUG)
{
echo "CAT: ".$selcat ;
echo "<br>:".$query."<br>";
echo $db->nf()."<br>";
}
unset($articleID);
unset($linkID);
unset($idcatID);
// get id's of sub articles
while ($db->next_record())
{
$articleID[] = $db->f("idsidelang");
$linkID[] = $db->f("idside");
$idcatID[] = $db->f("idcat");
} // end while
// loop through subarticles
IF (_DEBUG)
{
echo "<pre>articleID:<br>";
var_dump ($articleID);
echo "</pre>";
echo "<br><pre>linkID:<br>";
var_dump ($linkID);
echo "</pre>";
echo "<br><pre>idcatID:<br>";
var_dump ($idcatID);
echo "</pre>";
}
// now loop through ALL articles
foreach ($articleID as $key => $value)
{
// select all CMS variables of the article
$query = "SELECT * FROM $cfgTab_content WHERE idsidelang = '$value' ORDER BY typeid";
IF (_DEBUG)
{
echo "CAT: ".$selcat ;
echo "<pre><br>:".$query."<br>";
}
// execute query
$db->query($query);
IF (_DEBUG)
{
echo "select all CMS variables of the article:<br>";
var_dump ($articleID);
echo "</pre>";
}
// link
if ($sel_start=="0") {
$link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selcat&idside=$linkID[$key]&m=$m&s=$s");
} else {
$link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$idcatID[$key]&idside=$linkID[$key]&m=$m&s=$s");
}
// initialize vars to point out user Errors
if ($ueberschrift == u1) {$headx = " ÜBERSCHRIFT 1";};
if ($ueberschrift == u2) {$headx = " ÜBERSCHRIFT 2";};
if ($ueberschrift == t1) {$headx = "r TEXT 1";};
if ($ueberschrift == t2) {$headx = "r TEXT 2";};
$headline = "Für den Link ausgewählte".$headx." ist auf der Artikelseite noch nicht eingegeben worden!!!";
$text = ". . . ";
$img = "0";
// loop through result and extraxt data
while ($db->next_record())
{
// data type
$type = $db->f("idtype");
$type2 = $db->f("typeid"); // R.Meyer
if ($ueberschrift == u1) {$typeu = "1"; $type2u = "1";};
if ($ueberschrift == u2) {$typeu = "1"; $type2u = "2";};
if ($ueberschrift == t1) {$typeu = "3"; $type2u = "1";};
if ($ueberschrift == t2) {$typeu = "3"; $type2u = "2";};
if ($einfuehrung == u1) {$typee = "1"; $type2e = "1";};
if ($einfuehrung == u2) {$typee = "1"; $type2e = "2";};
if ($einfuehrung == t1) {$typee = "3"; $type2e = "1";};
if ($einfuehrung == t2) {$typee = "3"; $type2e = "2";};
if ($bildnr == 1) {$type2b = "1";};
if ($bildnr == 2) {$type2b = "2";};
if ($bildnr == 3) {$type2b = "3";};
if ($type == $typeu && $type2 == $contain.$type2u)
{ // headline "vorschau"
$headline = $db->f("value");
}
elseif ($type == $typee && $type2 == $contain.$type2e)
{ // text "vorschau"
$text = $db->f("value");
}
elseif ($type == 4 && $type2 == $contain.$type2b)
{ // image "vorschau"
$value = $db->f("value");
$query = "SELECT filename FROM $cfgTab_upl WHERE idupl = '$value'";
$db2->query($query);
$db2->next_record();
// $img = $cfgClient[$client]["htmlpath"]["img"] . $db2->f("filename");
$img = $cfgClient[$client]["frontendpath"]["img"] . $db2->f("filename");
} // end if
} // end while
IF (_DEBUG)
{
echo "<pre>headline:<br>";
var_dump ($headline);
echo "</pre>";
}
// headline length
$len = strlen($headline);
// cut headline if too long
if ($len > $mxh[0] && $mxh[0] > 0) {
$headline = substr($headline,0,$mxh[0]);
$headline = $headline. " ...";
} // end if
// text length
$len = strlen($text);
// cut text if too long
if ($len > $mxh[1] && $mxh[1] > 0) {
$text = substr($text,0,$mxh[1]);
$text = $text. " ...";
} ;// end if
//Bild skalieren
if($img=="0") {
if($imgposition=="left") {
$imglink = "<td width = $imgspace></td><td >";};
} else {
$imgsize = GetImageSize ("$img"); // Ermittelt die Ausmaße einer Image-Datei
$imgwidthorg = $imgsize[0]; // Img Breite
$imgheightorg = $imgsize[1]; // Img Hoehe
$zoomfaktor = $imgwidth/$imgwidthorg; // Zommfaktor ermitteln
$imgheight = $imgheightorg*$zoomfaktor; // Hoehe des verkleinerten Bildes
$imgheight = floor ($imgheight); // ganze positive Zahl
$imglink = "<td width=\"100%\"><IMG SRC='$img' width='$imgwidth' vspace=$imgspace hspace=$imgspace height='$imgheight' align='$imgposition'>";
};
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
<tr valign=\"top\">
$imglink
<a href=\"$link\">
<span $css_style =\"$fonthead\">$headline</span><br><br>
</a>
<span $css_style =\"$fonttext\">$text</span>
</td>
</tr>
<tr valign=\"bottom\" align=\"right\">
<td colspan=\"2\">
<table width=\"100%\" cellspacing=\"5\" cellpadding=\"0\" border=\"0\">
<td valign=\"middle\" align=\"right\" width=\"100%\">
<a href=\"$link\" $css_style =\"$fonttext\">$text_to
</a>
</td>
<td align=\"right\">
<a href=\"$link\">
<img src=\"".$cfgClient[$client]["frontendpath"]["img"].$image_to."\" border=\"0\">
</a>
</td>
</table>
</td>
</tr>
</table>";
echo $trenner;
unset($headline);
}; // end foreach
// Und Tschuess..
unset($css_style);
unset($db2);
unset($mod_active);
unset($contain);
unset($selcat );
unset($sel_start);
unset($fonthead);
unset($fonttext);
unset($mxh[0]);
unset($mxh[1]);
unset($imgwidth);
unset($imgheight);
unset($img);
unset($imgposition);
unset($text_to);
unset($image_to);
unset($trenner);
unset($imgspace);
} // end if Modul aktiv?