Ich hoffe ich bin hier nicht ganz falsch:
Fehler in Standard Hilfsnavigation 4.4.1.
Die Kategorien lassen sich nicht offline setzen.
Es fehlt auch offensichtlich die WHERE BEDINGUNG für die Kategorien die Online sind.
Vielleicht ein Tip von jemanden?
Hier der Code, ich habe probiert es selber zu fixen, blicke aber nicht so richtig durch.
Code: Alles auswählen
Ausgabe:
<?php
include_once($cfg["path"]["contenido"].$cfg["path"]["includes"]."functions.con.php");
$catStart = "CMS_VALUE[0]";
if ($catStart != "") {
$catIds = conDeeperCategoriesArray($catStart);
echo '<table cellpadding="0" cellspacing="0" border="0"><tr>';
echo '<td><img src="images/wuerfel.gif"></td>';
if ( is_array($catIds) ) {
foreach($catIds as $key=>$val) {
// Ersten Eintrag ueberspringen, weil das der Menupunkt selbst ist
// und nicht angezeigt werden soll.
if ($key != 0) {
$sql = "SELECT CAT.idcat AS idcat, name FROM ".
$cfg["tab"]["cat"]." AS CAT, ".
$cfg["tab"]["cat_lang"]." AS CATLANG
WHERE CAT.idcat = ".$val."
AND CAT.idcat = CATLANG.idcat
AND CATLANG.idlang = '$lang'";
$db->query($sql);
while ( $db->next_record() ) {
echo '<td height="21" class=".navigation" style="border: 0px; border-bottom:1px; border-color: #F7C473; border-style: solid; background-color: #FFFFFF; padding-left:7px; padding-right:7px;">
<a class="menue" href="front_content.php?idcat='.$db->f("idcat").'">'.$db->f("name").'</a></td>';
} // end while
} // if
} // end foreach
} // end if (is_array)
echo '</tr></table>';
}
?>
Code: Alles auswählen
Input:
// selected category
$selected = "CMS_VALUE[0]";
echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\">
<tr valign=\"top\">
<td>Kategorie wählen:</td>
<td>
<select name=\"CMS_VAR[0]\">";
if($selected!="0" && $selected!=""){
echo"<option value=\"0\">--- kein ---</option>";
}else{
echo"<option selected=\"selected\" value=\"0\">--- kein ---</option>";
}
// fetch all categorys
$query = "SELECT A.idcat, A.level, C.name FROM ".$cfg["tab"]["cat_tree"]." AS A, ".
$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C WHERE A.idcat=B.idcat ".
"AND B.idcat=C.idcat AND C.idlang='$lang' AND B.idclient='$client' ".
"AND C.visible=1 ORDER BY A.idtree";
// execute query
$db->query($query);
// loop result and build the options
while ($db->next_record()) {
// indent spacer
$spaces = "|";
// how many levels
$levels = $db->f("level");
for ($i = 0; $i < $levels; $i ++) {
// add 2 spaces for every level
$spaces = $spaces . "--";
} // end for
$spaces .= ">";
if ($selected == $db->f("idcat")) {
// selected category
echo "<option selected=\"selected\" value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";
} else {
// category
echo "<option value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";
} // end if
} // end while
echo " </select>";
echo " </td>
</tr>
</table>";