ich benutze eine leicht modifizierte Variante des Hilfsnavigationsmoduls und möchte, nachdem ein Frontend-Login stattgefunden hat, die Sub-Kategorien der ausgewählten Kategorie anzeigen. Ohne Anmeldung sollen die Kategorien verborgen bleiben.
Das Login-Modul funktioniert soweit ich das beurteilen kann, es wird nach Login leider nicht der name der geschützten Kategorie ausgegeben! Entferne ich den Schutz, so wird der Navpunkt ganz normal ausgegeben... Ich tippe auf einen Fehler in includes/functions.navigation.php, versteh' den Code da aber nicht wirklich... $navigation = createNavigationArray($catStart, $db); liefert keinen Wert zurück, sollte aber nach Login. Kann mir wer Tipps geben?
Gruß
(Contenido 4.6.23)
Input:
Code: Alles auswählen
// 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>";
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Hilfsnavigation
* Author(s) : Andreas Lindner
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 05.08.2005
************************************************/
cInclude("frontend", "includes/functions.navigation.php");
cInclude('classes', 'class.template.php');
echo " <div id=\"meta\"><p>";
$catStart = "CMS_VALUE[0]";
if(($catStart=='')||($catStart=='0')){
$cApiClient = new cApiClient($client);
$catStart = $cApiClient->getProperty('navigation', 'idcat_hilfsnavi');
}
$navigation = array();
$navigation = createNavigationArray($catStart, $db);
if (count($navigation) > 0) {
foreach ($navigation as $key => $data) {
if ($idcat == $data['idcat']) {
echo '<div class="aBasea"><a href="'.$sess->url('front_content.php?idcat='.$data['idcat']).'">'.$data['name'].'</a></div>';
} else {
echo '<div class="aBase"><a href="'.$sess->url('front_content.php?idcat='.$data['idcat']).'">'.$data['name'].'</a></div>';
}
}
}
echo "</div>";
?>