ich habe folgendes Problem:
Für ein neues Projekt habe ich die 4.5.2 ALPHA Version installiert (nebenbei bemerkt: wirklich klasse!).
Es funktioniert alles nahezu perfekt. Allerdings habe ich ein altbekanntes Problem mit der Artikelliste (Output siehe unten). Leider wird der Startartikel der Kategorie in der Liste wieder angezeigt. Das Problem ist für die 4.4.x Version ja bereits im Forum gelöst worden. In der 4.5 ist es nun wieder da...
Hat jemand eine Idee? Liegt es an der 4.5 oder habe ich was übersehen?
Hier der verwendete "Output" (wie gesagt: mit 4.4.x funktioniert es einwandfrei):
Code: Alles auswählen
<?php
$anzahl = "CMS_VALUE[8]";
if($anzahl<1) {$anzahl=10;}
$laenge = "CMS_VALUE[9]";
if($laenge<1) {$laenge=100;}
$sql = "SELECT ARTLANG.idart, ARTLANG.title, CATART.idcat, ARTLANG.created, CONTENT.value, CONTENT.idtype, CONTENT.typeid
FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".$cfg["tab"]["art_lang"]." AS ARTLANG, ".$cfg["tab"]["cat"]." AS CAT, ".$cfg["tab"]["content"]." AS CONTENT
WHERE ARTLANG.idart = CATART.idart AND CATART.idcat = CAT.idcat AND ARTLANG.idartlang=CONTENT.idartlang AND CONTENT.idtype<=2 AND CONTENT.typeid<=2 AND CAT.idcat='$idcat' AND ARTLANG.idlang = '$lang' AND ARTLANG.online = '1' AND CATART.is_start='0'
ORDER BY ARTLANG.artsort ASC,ARTLANG.created DESC";
$db->query($sql);
if ($db->num_rows() != 0)
{
echo "<br><table border=0 cellspacing=0 cellpadding=0 class=\"text\">";
$artikel = array(array());
$j=0;
$db->next_record();
$idart_last=$db->f("idart");
for ($i=0; $i<$db->num_rows(); $i++)
{
$artikel[$j][0] = $db->f("idart");
$artikel[$j][1] = $db->f("idcat");
$artikel[$j][2] = substr($db->f("created"),8,2).".".substr($db->f("created"),5,2).".";
while ( $idart_last==$db->f("idart") )
{
if ( $db->f("idtype") == 2 && $db->f("typeid") == 1 )
{
$html_text = strip_tags(urldecode($db->f("value")));
$array = array ("ä" => "ä", "ö" => "ö", "ü" => "ü", "ß" => "ß", "Ä" => "Ä", "Ö" => "Ö", "Ü" => "ü", " " => " ", """ => "\"", "<" => "<", ">" => ">", "&" => "&");
$html_text = strtr($html_text, $array);
$artikel[$j][5] = htmlentities(substr($html_text,0,$laenge))."...";
} elseif ( $db->f("idtype") == 1 && $db->f("typeid") == 1 )
{
$artikel[$j][3] = strip_tags(urldecode($db->f("value")));
} elseif ( $db->f("idtype") == 1 && $db->f("typeid") == 2 )
{
$artikel[$j][4] = strip_tags(urldecode($db->f("value")));
}
$idart_last=$db->f("idart");
$db->next_record();
$i++;
}
$idart_last=$db->f("idart");
$j++;
$i--;
}
if($blatt=="") {$blatt=0;}
$blattmax=ceil($j/$anzahl)-1;
$blatt1 = $blatt+1;
$blattmax1 = $blattmax+1;
if ($j>$anzahl)
{
echo " <tr>
<td class=\"artikelliste\" colspan=3 align=\"right\">Seite <b>".$blatt1."</b> von ".$blattmax1." - ";
for ($i=0; $i<=$blattmax; $i++)
{
$k = $i+1;
if($i==$blatt) {
echo " ".$k." | ";
} else {
$navmod_link ="front_content.php?client=$client&lang=$lang&idcat=$idcat&blatt=".$i."";
echo ' <a href="'.$sess->url("$navmod_link").'" class="artikelliste"><u>'.$k.'</u><br></a> ';
}
}
echo "</td>
</tr>";
}
for ($i=$anzahl*$blatt; $i < min($j,$anzahl*$blatt+$anzahl); $i++)
{
$k = $i-1;
$navmod_link ="front_content.php?client=$client&lang=$lang&idcat=".$artikel[$i][1]."&idart=".$artikel[$i][0]."";
echo '<tr>';
if ( $i>0 && $artikel[$i][2] == $artikel[$k][2] )
{
echo '<td class=\"newsbox\"> </td>';
} else
{
echo '<td class=\"newsbox\" valign="top"></td>';
}
echo '<td class=\"newsbox\"><b><a href="'.$sess->url("$navmod_link").'" id="font">'.$artikel[$i][3].'</a></b><img src="upload/layout/dot_red.gif" width="100%" height="1" vspace="1"><br> '.$artikel[$i][5].' <a href="'.$sess->url("$navmod_link").'" id="link_klein"><img src="upload/layout/pfeil_mehr.gif" width="14" height="10" border="0"> mehr</a><br><br></td>
</tr>';
}
if ($j>$anzahl)
{
echo " <tr>
<td class=\"artikelliste\" colspan=3 align=\"right\"><br>Seite <b>".$blatt1."</b> von ".$blattmax1." - ";
for ($i=0; $i<=$blattmax; $i++)
{
$k = $i+1;
if($i==$blatt) {
echo " ".$k." |";
} else {
$navmod_link ="front_content.php?client=$client&lang=$lang&idcat=$idcat&blatt=".$i."";
echo ' <a href="'.$sess->url("$navmod_link").'" class="artikelliste"><u>'.$k.'</u></a> ';
}
}
echo "</td>
</tr>";
}
echo '</table>';
}
?>
Wäre klasse, wenn mir jemand helfen könnte.
Gruß
Andreas