From 8e50e5eb4e9ffc37e1d97aa39c22295086212f6a Mon Sep 17 00:00:00 2001 From: Bart van Bragt Date: Mon, 26 Nov 2001 12:09:37 +0000 Subject: Implemented Navigation bar in Mozilla git-svn-id: file:///svn/phpbb/trunk@1452 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/common.php | 24 +++++++++++- phpBB/includes/functions.php | 11 ++++++ phpBB/includes/page_header.php | 28 ++++++++++++-- phpBB/templates/subSilver/overall_header.tpl | 6 +-- phpBB/viewforum.php | 10 ++++- phpBB/viewtopic.php | 56 ++++++++++++++++++---------- 6 files changed, 107 insertions(+), 28 deletions(-) (limited to 'phpBB') diff --git a/phpBB/common.php b/phpBB/common.php index ea5f7a7e4b..f8f124c3f2 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -117,6 +117,28 @@ include($phpbb_root_path . 'includes/auth.'.$phpEx); include($phpbb_root_path . 'includes/functions.'.$phpEx); include($phpbb_root_path . 'includes/db.'.$phpEx); +// +// Mozilla navigation bar +// Default items that should be valid on all pages. +// Defined here and not in page_header.php so they can be redefined in the code +// +$nav_links['top'] = array ( + 'url' => append_sid($phpbb_root_dir."index.".$phpEx), + 'title' => sprintf($lang['Forum_Index'], $board_config['sitename']) +); +$nav_links['search'] = array ( + 'url' => append_sid($phpbb_root_dir."search.".$phpEx), + 'title' => $lang['Search'] +); +$nav_links['help'] = array ( + 'url' => append_sid($phpbb_root_dir."faq.".$phpEx), + 'title' => $lang['FAQ'] +); +$nav_links['author'] = array ( + 'url' => append_sid($phpbb_root_dir."memberlist.".$phpEx), + 'title' => $lang['Memberlist'] +); + // // Obtain and encode users IP // @@ -162,4 +184,4 @@ if( $board_config['board_disable'] && !defined("IN_ADMIN") ) message_die(GENERAL_MESSAGE, 'Board_disable', 'Information'); } -?> \ No newline at end of file +?> diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4c93d6a6f7..063cc8027b 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -119,6 +119,7 @@ function get_userdata($username) { function make_jumpbox($match_forum_id = 0) { global $lang, $db, $SID; + global $nav_links, $phpEx; $sql = "SELECT c.cat_id, c.cat_title, c.cat_order FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f @@ -160,6 +161,16 @@ function make_jumpbox($match_forum_id = 0) { $selected = ( $forum_rows[$j]['forum_id'] == $match_forum_id ) ? "selected=\"selected\"" : ""; $boxstring .= ''; + + // + // Add an array to $nav_links for the Mozilla navigation bar. + // 'chapter' and 'forum' can create multiple items, therefore we are using a nested array. + // + $nav_links['chapter forum'][$forum_rows[$j]['forum_id']] = array ( + 'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=". $forum_rows[$j]['forum_id']), + 'title' => $forum_rows[$j]['forum_name'] + ); + } } } diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php index a73d3fd648..192cc8e264 100644 --- a/phpBB/includes/page_header.php +++ b/phpBB/includes/page_header.php @@ -206,6 +206,27 @@ else $s_privmsg_new = 0; } +// +// Generate HTML required for Mozilla Navigation bar +// +$nav_links_html = ''; +$nav_link_proto = ''."\n"; +while(list($nav_item, $nav_array) = @each($nav_links) ) +{ + if( !empty($nav_array['url']) ) + { + $nav_links_html .= sprintf($nav_link_proto, $nav_item, $nav_array['url'], $nav_array['title']); + } + else + { + // We have a nested array, used for items like that can occur more than once. + while(list(,$nested_array) = each($nav_array) ) + { + $nav_links_html .= sprintf($nav_link_proto, $nav_item, $nested_array['url'], $nested_array['title']); + } + } +} + // // The following assigns all _common_ variables that may be used at any point // in a template. Note that all URL's should be wrapped in append_sid, as @@ -336,10 +357,11 @@ $template->assign_vars(array( "T_FONTCOLOR3" => "#".$theme['fontcolor3'], "T_SPAN_CLASS1" => $theme['span_class1'], "T_SPAN_CLASS2" => $theme['span_class2'], - "T_SPAN_CLASS3" => $theme['span_class3']) + "T_SPAN_CLASS3" => $theme['span_class3'], + + "NAV_LINKS" => $nav_links_html) ); - // // Login box? // @@ -367,4 +389,4 @@ header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); $template->pparse("overall_header"); -?> \ No newline at end of file +?> diff --git a/phpBB/templates/subSilver/overall_header.tpl b/phpBB/templates/subSilver/overall_header.tpl index 724c9551c0..f60a32af28 100644 --- a/phpBB/templates/subSilver/overall_header.tpl +++ b/phpBB/templates/subSilver/overall_header.tpl @@ -1,12 +1,10 @@ - - - + {META} +{NAV_LINKS} {SITENAME} :: {PAGE_TITLE}