ich stehe momentan auf dem Schlauch. Ich setze das o.g. Modul ein bei contenido 4.6.23. Wenn ich den Code richtig verstehe werden die Artikel der Liste nach Veränderungsdatum (lastmodified) sortiert und ausgegeben. Tatsächlich ist die Sortierung richtig, das ausgegebene Datum ist aber das Datum der Ersterstellung. Kann mir jemand von Euch auf die Sprünge helfen?
Viele Grüsse,
Christian
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* REFERENZ MODUL / ARTIKELLISTE
*
* Artikelliste mit Img 1, Head 1, Head 2
*
* Erstellt eine Liste mit allen Artikel bis
* auf den Startartikel.
*
* Author : Jan Lengowski
* Copyright : four for business AG
* Created : 15-08-2002
* Modified : 16-08-2002
************************************************/
// second db class instance
$db2 = new DB_Contenido;
// selected category
$selcat = "CMS_VALUE[0]";
if($selcat!="0" && $selcat!=""){
// select all articles in category widthout start article
$query = "SELECT ARTLANG.idart, ARTLANG.idartlang, ARTLANG.created FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".
$cfg["tab"]["art_lang"]." AS ARTLANG ".
"WHERE CATART.idcat = '$selcat' AND ARTLANG.idart = CATART.idart AND ARTLANG.idlang = '$lang' AND ".
"ARTLANG.online = '1' AND CATART.is_start = '0' ORDER BY ARTLANG.lastmodified DESC";
// execute query
$db->query($query);
unset($articleID);
unset($linkID);
// get id's of sub articles
while ($db->next_record()) {
$articleID[] = $db->f("idartlang");
$linkID[] = $db->f("idart");
} // end while
// loop through subarticles
echo '
<table width="540" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan ="2" style="border: 1px; border-left:0px; border-color: #97A4B5; border-style: solid; background-color: #B1C6D9; padding-left:10px" class="punkte">CMS_VALUE[2]</td>
</tr>
';
if (is_array($articleID)) {
foreach ($articleID as $key => $value) {
// select all CMS variables of the article
$sql = "SELECT * FROM ".$cfg["tab"]["content"]." WHERE idartlang = '$value' AND idtype = '1' AND typeid = '1'";
$db->query($sql);
$db->next_record();
$head = $db->f("value");
$lastmodified = substr(($db->f("lastmodified")),0,10);
$lastmodified = substr($lastmodified,8,2).".".substr($lastmodified,5,2).".".substr($lastmodified,0,4);
if ( strlen($head) > "CMS_VALUE[3]") {
$head = substr($head, 0, "CMS_VALUE[3]");
$head .= '..';
}
// link
$link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selcat&idart=$linkID[$key]&m=$m&s=$s");
echo '<tr>
<td class="text" height="22" style="border: 1px; border-top:0px; border-color: #97A4B5; border-style: solid; background-color: #FFFFFF; padding-left:10px"><a href="'.$link.'">'.urldecode($db->f("value")).'</a></td>
<td class="text" height="22" style="border: 1px; border-top:0px; border-color: #97A4B5; border-style: solid; background-color: #FFFFFF; padding-left:10px">'.$lastmodified.'</td>
</tr>';
} // end while
unset($headline);
unset($text);
} // end foreach
} // end if (is_array)
echo '</table><br>';
?>