Well I have mixed the lines.
But I think that you have figured it out quite fast.
Here is the fixed nav_level_row
Code: Select all
// -------------------------------------------------------------
function nav_level_row($show_id, $show_home=1) {
//returns a simple row based navigation
if(strtoupper($show_id) == "CURRENT") {
$act_cat_id = $GLOBALS['content']["cat_id"];
} else {
$act_cat_id = intval($show_id);
}
$nav = '';
if($show_home) {
if($GLOBALS['content']["cat_id"] == $act_cat_id) {
$before = $GLOBALS['template_default']["nav_row"]["link_before_active"];
$after = $GLOBALS['template_default']["nav_row"]["link_after_active"];
} else {
$before = $GLOBALS['template_default']["nav_row"]["link_before"];
$after = $GLOBALS['template_default']["nav_row"]["link_after"];
}
$nav .= $before;
$nav .= '<a href="index.php?';
$nav .= ($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) ? html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) : 'id='.$act_cat_id.',0,0,1,0,0';
$nav .= '">'.html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_name']).'</a>';
$nav .= $after;
}
$breadcrumb = get_breadcrumb($GLOBALS['content']["cat_id"], $GLOBALS['content']["struct"]);
foreach($GLOBALS['content']['struct'] as $key => $value) {
if($GLOBALS['content']['struct'][$key]["acat_struct"] == $act_cat_id && $key != $act_cat_id && !$GLOBALS['content']['struct'][$key]['acat_hidden']) {
if($nav) $nav .= $GLOBALS['template_default']["nav_row"]["between"];
//$GLOBALS['content']["cat_id"] == $key
if($breadcrumb[$key]) {
$before = $GLOBALS['template_default']["nav_row"]["link_before_active"];
$after = $GLOBALS['template_default']["nav_row"]["link_after_active"];
} else {
$before = $GLOBALS['template_default']["nav_row"]["link_before"];
$after = $GLOBALS['template_default']["nav_row"]["link_after"];
}
$nav .= $before;
$nav .= '<a href="index.php?';
$nav .= ($GLOBALS['content']['struct'][$key]['acat_alias']) ? html_specialchars($GLOBALS['content']['struct'][$key]['acat_alias']) : 'id='.$key.',0,0,1,0,0';
$nav .= '">'.html_specialchars($GLOBALS['content']['struct'][$key]['acat_name']).'</a>';
$nav .= $after;
}
}
if($nav) {
$nav = $GLOBALS['template_default']["nav_row"]["before"].$nav;
$nav .= $GLOBALS['template_default']["nav_row"]["after"];
}
return $nav;
}
And guys please do it in English.
I don't speak/understand any German.
//BR
Cyrilo (Kiril Jovchev)