array ( NAV_VISIBLE => true, NAV_ENABLE => true, NAV_SHOW => "japan", NAV_URL => "nihon/", NAV_TARGET => "" ), 'photos' => array ( NAV_VISIBLE => true, NAV_ENABLE => true, NAV_SHOW => "photos", NAV_URL => "photo/", NAV_TARGET => "" ), 'random' => array ( NAV_VISIBLE => true, NAV_ENABLE => false, NAV_SHOW => "random", NAV_URL => "", NAV_TARGET => "" ), 'links' => array ( NAV_VISIBLE => true, NAV_ENABLE => false, NAV_SHOW => "links", NAV_URL => "mesh/", NAV_TARGET => "" ), 'cv' => array ( NAV_VISIBLE => true, NAV_ENABLE => true, NAV_SHOW => "résumé / c.v.", NAV_URL => "cv/", NAV_TARGET => "" ), 'email' => array ( NAV_VISIBLE => true, NAV_ENABLE => true, NAV_SHOW => "email", NAV_URL => "mailto:jeffmk@myrealbox.com", NAV_TARGET => "_blank" ), ); #################################################################################################### ## count number of visible items in [$a] function nav_count_visible($a) { $i = 0; foreach ($a as $item) { if ($item[NAV_VISIBLE]) { ++$i; } } return $i; } ## display navigator [$nav_items] function nav_show($nav_items) { global $skin; $i = 0; $cnt = nav_count_visible($nav_items); if ($cnt == 0) { return false; } $html = "::\n\n"; foreach ($nav_items as $item) { if ($item[NAV_VISIBLE]) { $show = htmlentities($item[NAV_SHOW],ENT_QUOTES); $target = htmlentities($item[NAV_TARGET],ENT_QUOTES); $url = htmlentities($item[NAV_URL],ENT_QUOTES); if ($item[NAV_ENABLE]) { $append = "skin={$skin}"; if ($append != '' && strpos($url,'mailto:') === false && strpos($url,'javascript:') === false) { $url = $url . (strpos($url,'?') ? '&' : '?') . $append; } $html .= "{$show}"; } else { $html .= $show; } $html .= (++$i < $cnt ? "\n|\n" : ""); } } $html .= "\n\n"; return $html; } #################################################################################################### ?> .. you have summoned ( möbius )
( möbius )