Wir haben ca. 500 Seiten und sind noch bei der Migration...
Für die aktuelle Version müsste es dann so aussehen:
Code: Alles auswählen
a.level AS level,
b.idcat AS idcat,
b.idcatart AS idcatart,
b.is_start AS is_start,
d.name AS name,
d.visible,
e.title AS title,
e.online AS online
Mein Vorschlag wäre:
Code: Alles auswählen
while ( $db->next_record() ) {
$spaces = "";
for ($i=0; $i<$db->f("level"); $i++) {
$spaces .= " ";
}
$tmp_title = $db->f("title");
if ( strlen($tmp_title) > 32 ) { // take care that title is not too long
$tmp_title = substr($tmp_title, 0, 32);
}
if ($db->f("is_start") == "1"){
echo "<option value=\"front_content.php?idcatart=".$db->f("idcatart")."&lang=$lang&client=$client\"";
if ( $db->f("online") == "0" || $db->f("visible") == "0" ) echo " style=\"color:#666666;\""; // offline categories are grey
echo ">$spaces > ".$db->f("name").": ".$tmp_title."</option>";
} else {
echo "<option value=\"front_content.php?idcatart=".$db->f("idcatart")."&lang=$lang&client=$client\"";
if ( $db->f("online") == "0" || $db->f("visible") == "0" ) echo " style=\"color:#666666;\""; // offline articles are grey
echo ">$spaces - ".$tmp_title."</option>";
}
}
Das vereint das beste aus beiden Welten (und die Einrückung sieht "echt" aus). Der Code hat ein einer Stelle ein (auch als Feature zu betrachtendes) Problem: Es zeigt Kategorien ohne Startartikel nicht an. Das dürfte sich aber m.E. Kategorien betreffen, die gar keine Artikel enthalten - das sieht bei uns ganz gut aus (d.h. die "tote" Kategorie kann gar nicht ausgewählt werden).
Ich schaue später nochmal rein.
Gruß
HerrB