{NAV_LIST_TOP} -- bug or misunderstanding on my part?

Use GitHub to post bug reports and error descriptions for phpwcms. Describe your problem detailed!
cyrilo
Posts: 9
Joined: Mon 17. May 2004, 11:57

{NAV_ROW} fixed

Post by cyrilo »

Hi,

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;
}
Well this is it.

And guys please do it in English.
I don't speak/understand any German.

//BR
Cyrilo (Kiril Jovchev)
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

hehe thanks,

I did it yesterday - a bit different than yours.
Check the diffs here

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
cyrilo
Posts: 9
Joined: Mon 17. May 2004, 11:57

Post by cyrilo »

Well your way seems better ;-)
But you know the system better, and you are better in php than me.

Regards
Cyrilo
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

No problem - it's only a little difference (but based on your work).

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Locked