Neue Features:
- Wahl der Sortierung (nach Artikel-ID, Topic, Erstellungdsatum, Änderungsdatum, Seitentitel [Backend], Seitentitel [Frontend], Zusammenfassung [Backend] oder Sort-Nummer). Allerdings nur eins auf einmal, wir wollen ja nicht übertreiben...
- Wahl der Anzeige des Startartikels
- Sofern der Startartikel angezeigt wird, optional: Anzeige des Startartikels an erster Stelle
- Auswahl des Nummer des verwendeten Inhaltstyps (z.B. 3 bei CMS_HTML[3]), der das Topic enthält
- Auswahl des Inhaltstyps, der das Topic enthält
- Begrenzung der Anzahl der angezeigten Topics
Trotzdem entspricht das Modul der Standardartikelliste insoweit, dass die Topics wie im Standardmandanten (sprich: in orange) ausgegeben werden - da muss man nach wie vor selbst Hand anlegen, das Modul ist als Basis für eigene Aktivitäten gedacht.
Hinweis: Dieses Modul ist nicht mit V4.5.x kompatibel.
Beschreibung:
Code: Alles auswählen
Artikelliste V4.4.5 V2.0.1
Basiert auf der Standardartikelliste von Contenido V4.4.x (Autor: Jan Legowski, 4fb).
Überarbeitet von HerrB, 06.02.2005
Code: Alles auswählen
$selected = "CMS_VALUE[0]"; // selected category
echo ' <table cellspacing="0" cellpadding="10" border="0">',chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td class="text_medium">Kategorie wählen:</td>',chr(10);
echo ' <td class="text_medium"><select name="CMS_VAR[0]">',chr(10);
if ($selected != "0" && $selected != "") {
echo ' <option value="0">--- kein ---</option>',chr(10);
} else {
echo ' <option selected="selected" value="0">--- kein ---</option>',chr(10);
}
// fetch all categorys
$query = "SELECT A.idcat, A.level, C.name FROM ".$cfg["tab"]["cat_tree"]." AS A, ";
$query .= $cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C WHERE A.idcat=B.idcat ";
$query .= "AND B.idcat=C.idcat AND C.idlang='$lang' AND B.idclient='$client' ";
$query .= "AND C.visible=1 ORDER BY A.idtree";
// execute query
$db->query($query);
// loop result and build the options
while ($db->next_record()) {
$spaces = "|"; // indent spacer
$levels = $db->f("level"); // how many levels
for ($i = 0; $i < $levels; $i++) {
$spaces = $spaces . "--"; // add 2 spaces for every level
}
$spaces .= ">";
if ($selected == $db->f("idcat")) {
// selected category
echo '<option selected="selected" value="'. $db->f("idcat") .'">'. $spaces . $db->f("name") .'</option>',chr(10);
} else {
// category
echo '<option value="'. $db->f("idcat") .'">'. $spaces . $db->f("name") .'</option>',chr(10);
}
}
echo ' </select>',chr(10);
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
echo ' <td class="text_medium">Überschrift</td>',chr(10);
echo ' <td class="text_medium"><input type="text" name="CMS_VAR[2]" value="CMS_VALUE[2]"></td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
echo ' <td class="text_medium">Angezeigte Länge in Zeichen</td>',chr(10);
if (!is_numeric("CMS_VALUE[3]")) {
echo ' <td class="text_medium"><input type="text" name="CMS_VAR[3]" value="50"></td>',chr(10);
} else {
echo ' <td class="text_medium"><input type="text" name="CMS_VAR[3]" value="CMS_VALUE[3]"></td>',chr(10);
}
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
echo ' <td class="text_medium" style="vertical-align: top;">Sortiert nach:</td>',chr(10);
echo ' <td class="text_medium"><select name="CMS_VAR[4]">',chr(10);
if ("CMS_VALUE[4]" == "" || "CMS_VALUE[4]" == "CATART.idart") {
echo ' <option value="CATART.idart" selected>Artikel-ID</option>',chr(10);
} else {
echo ' <option value="CATART.idart">Artikel-ID</option>',chr(10);
}
if ("CMS_VALUE[4]" == "CONTENT.value") {
echo ' <option value="CONTENT.value" selected>Topic</option>',chr(10);
} else {
echo ' <option value="CONTENT.value">Topic</option>',chr(10);
}
if ("CMS_VALUE[4]" == "ARTLANG.created") {
echo ' <option value="ARTLANG.created" selected>Erstellungsdatum</option>',chr(10);
} else {
echo ' <option value="ARTLANG.created">Erstellungsdatum</option>',chr(10);
}
if ("CMS_VALUE[4]" == "ARTLANG.lastmodified") {
echo ' <option value="ARTLANG.lastmodified" selected>Änderungsdatum</option>',chr(10);
} else {
echo ' <option value="ARTLANG.lastmodified">Änderungssdatum</option>',chr(10);
}
if ("CMS_VALUE[4]" == "ARTLANG.title") {
echo ' <option value="ARTLANG.title" selected>Seitentitel (Backend)</option>',chr(10);
} else {
echo ' <option value="ARTLANG.title">Seitentitel (Backend)</option>',chr(10);
}
if ("CMS_VALUE[4]" == "ARTLANG.pagetitle") {
echo ' <option value="ARTLANG.pagetitle" selected>Seitentitel (Frontend)</option>',chr(10);
} else {
echo ' <option value="ARTLANG.pagetitle">Seitentitel (Frontend)</option>',chr(10);
}
if ("CMS_VALUE[4]" == "ARTLANG.summary") {
echo ' <option value="ARTLANG.summary" selected>Zusammenfassung (Backend)</option>',chr(10);
} else {
echo ' <option value="ARTLANG.summary">Zusammenfassung (Backend)</option>',chr(10);
}
if ("CMS_VALUE[4]" == "ARTLANG.artsort") {
echo ' <option value="ARTLANG.artsort" selected>Sort No.</option>',chr(10);
} else {
echo ' <option value="ARTLANG.artsort">Sort No.</option>',chr(10);
}
echo ' </select><br>',chr(10);
if ("CMS_VALUE[5]" != "DESC") {
echo ' <input type="radio" name="CMS_VAR[5]" value="ASC" checked>Aufsteigend <input type="radio" name="CMS_VAR[5]" value="DESC">Absteigend',chr(10);
} else {
echo ' <input type="radio" name="CMS_VAR[5]" value="ASC">Aufsteigend <input type="radio" name="CMS_VAR[5]" value="DESC" checked>Absteigend',chr(10);
}
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
echo ' <td class="text_medium" style="vertical-align: top;">Startartikel:</td>',chr(10);
if ("CMS_VALUE[6]" != "enabled") {
echo ' <td class="text_medium"><input type="checkbox" name="CMS_VAR[6]" value="enabled">Anzeigen ';
} else {
echo ' <td class="text_medium"><input type="checkbox" name="CMS_VAR[6]" value="enabled" checked>Anzeigen ';
}
if ("CMS_VALUE[7]" != "enabled") {
echo '<input type="checkbox" name="CMS_VAR[7]" value="enabled">An erster Stelle</td>',chr(10);
} else {
echo '<input type="checkbox" name="CMS_VAR[7]" value="enabled" checked>An erster Stelle</td>',chr(10);
}
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
echo ' <td class="text_medium" style="vertical-align: top;">Topic-Identifikation:</td>',chr(10);
echo ' <td class="text_medium" style="vertical-align: top;">Inhaltstyp: <select name="CMS_VAR[9]">',chr(10);
if (!is_numeric("CMS_VALUE[9]") || !in_array("CMS_VALUE[9]", array("1","2","3","9"))) {
echo ' <option value="1" selected>CMS_HTMLHEAD</option>',chr(10);
} else {
echo ' <option value="1">CMS_HTMLHEAD</option>',chr(10);
}
if ("CMS_VALUE[9]" == "2") {
echo ' <option value="2" selected>CMS_HTML</option>',chr(10);
} else {
echo ' <option value="2">CMS_HTML</option>',chr(10);
}
if ("CMS_VALUE[9]" == "3") {
echo ' <option value="3" selected>CMS_TEXT</option>',chr(10);
} else {
echo ' <option value="3">CMS_TEXT</option>',chr(10);
}
if ("CMS_VALUE[9]" == "9") {
echo ' <option value="9" selected>CMS_HEAD</option>',chr(10);
} else {
echo ' <option value="9">CMS_HEAD</option>',chr(10);
}
echo ' </select><br>',chr(10);
if (!is_numeric("CMS_VALUE[8]")) {
echo ' Typ-Nummer (z.B. 3 bei CMS_HTML[3]): <input type="text" name="CMS_VAR[8]" length="5" maxlength="10" value="1">',chr(10);
} else {
echo ' Typ-Nummer (z.B. 3 bei CMS_HTML[3]): <input type="text" name="CMS_VAR[8]" length="5" maxlength="10" value="CMS_VALUE[8]">',chr(10);
}
echo ' </td>',chr(10);
echo ' </tr>',chr(10);
echo ' <tr>',chr(10);
echo ' <td class="text_medium">Artikelanzahl (0 = keine Begrenzung):</td>',chr(10);
if (!is_numeric("CMS_VALUE[10]")) {
echo ' <td class="text_medium"><input type="text" name="CMS_VAR[10]" value="0"></td>',chr(10);
} else {
echo ' <td class="text_medium"><input type="text" name="CMS_VAR[10]" value="CMS_VALUE[10]"></td>',chr(10);
}
echo ' </tr>',chr(10);
echo ' </table>',chr(10);
Code: Alles auswählen
<?php
$selCat = "CMS_VALUE[0]"; // selected category
$maxChar = "CMS_VALUE[3]"; // Max. shown topic length
if (!is_numeric($maxChar) || $maxChar < 1) {
$maxChar = "50";
}
if(is_numeric($selCat) && $selCat != "0") {
// select all articles in category without start article
$query = "SELECT CONTENT.value AS headline, ARTLANG.idart AS id FROM ";
$query .= $cfg["tab"]["cat_art"]." AS CATART, ";
$query .= $cfg["tab"]["art_lang"]." AS ARTLANG, ";
$query .= $cfg["tab"]["content"]." AS CONTENT ";
$query .= "WHERE CATART.idcat = '$selCat' ";
if ("CMS_VALUE[6]" != "enabled") {
$query .= "AND CATART.is_start = '0' ";
}
$query .= "AND CONTENT.idartlang = ARTLANG.idartlang ";
// Content-Type-Number
if (!is_numeric("CMS_VALUE[8]")) {
$query .= "AND CONTENT.typeid = '1' ";
} else {
$query .= "AND CONTENT.typeid = 'CMS_VALUE[8]' ";
}
// Content-Type
if (!is_numeric("CMS_VALUE[9]")) {
$query .= "AND CONTENT.idtype = '1' ";
} else {
$query .= "AND CONTENT.idtype = 'CMS_VALUE[9]' ";
}
$query .= "AND ARTLANG.idart = CATART.idart AND ARTLANG.idlang = '$lang' ";
$query .= "AND ARTLANG.online = '1' ORDER BY ";
if ("CMS_VALUE[6]" == "enabled" && "CMS_VALUE[7]" == "enabled") { // Startartikel an erster Stelle
$query .= "CATART.is_start DESC, ";
}
// Sort by
if ("CMS_VALUE[4]" == "") {
$query .= "CATART.idart ";
} else {
$query .= "CMS_VALUE[4] ";
}
// ASC/DESC
if ("CMS_VALUE[5]" == "") {
$query .= "DESC ";
} else {
$query .= "CMS_VALUE[5] ";
}
// LIMIT
if (is_numeric("CMS_VALUE[10]") && "CMS_VALUE[10]" > 0) {
$query .= "LIMIT 0, CMS_VALUE[10]";
}
// execute query
$db->query($query);
if ($db->num_rows() > 0) {
// Table header
echo '<table width="165" border="0" cellspacing="0" cellpadding="0">';
echo '<tr><td height="30" colspan="2" ></td></tr>';
echo '<tr><td height="21" width="22" style="border: 0px; border-top:1px; border-bottom:1px; border-color: #F7C473; border-style: solid; background-color: #FCF2D5"><img src="images/wuerfel.gif" width="22" height="21" border="0"></td>';
echo '<td width="143" style="border: 1px; border-left:0px; border-color: #F7C473; border-style: dashed; background-color: #FCF2D5; padding-left:10px" class="punkte">CMS_VALUE[2]</td></tr>';
while ($db->next_record()) {
$headline = urldecode($db->f("headline"));
if (strlen($headline) > $maxChar) {
$headline = substr($headline, 0, $maxChar);
$headline .= '..';
}
$link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selCat&idart=".$db->f("id")."&m=$m&s=$s");
echo '<tr><td colspan="2" class="text" height="22" style="border: 1px; border-top:0px; border-color: #F7C473; border-style: dashed; background-color: #FCF2D5; padding-left:10px"><a href="'.$link.'">'.$headline.'</a></td></tr>';
} // end while
unset($headline);
echo '</table><br>';
} // end if
} // end if
?>
Gruß
HerrB