diff options
author | Bart van Bragt <bartvb@users.sourceforge.net> | 2001-11-26 12:09:37 +0000 |
---|---|---|
committer | Bart van Bragt <bartvb@users.sourceforge.net> | 2001-11-26 12:09:37 +0000 |
commit | 8e50e5eb4e9ffc37e1d97aa39c22295086212f6a (patch) | |
tree | 9fe6c27d9b9aa2fdac8a62cc1311f7205560ac21 /phpBB | |
parent | dabc3a4b843b8de7badeac75af100f40458fd873 (diff) | |
download | forums-8e50e5eb4e9ffc37e1d97aa39c22295086212f6a.tar forums-8e50e5eb4e9ffc37e1d97aa39c22295086212f6a.tar.gz forums-8e50e5eb4e9ffc37e1d97aa39c22295086212f6a.tar.bz2 forums-8e50e5eb4e9ffc37e1d97aa39c22295086212f6a.tar.xz forums-8e50e5eb4e9ffc37e1d97aa39c22295086212f6a.zip |
Implemented Navigation bar in Mozilla
git-svn-id: file:///svn/phpbb/trunk@1452 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/common.php | 24 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 11 | ||||
-rw-r--r-- | phpBB/includes/page_header.php | 28 | ||||
-rw-r--r-- | phpBB/templates/subSilver/overall_header.tpl | 6 | ||||
-rw-r--r-- | phpBB/viewforum.php | 10 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 56 |
6 files changed, 107 insertions, 28 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index ea5f7a7e4b..f8f124c3f2 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -118,6 +118,28 @@ 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 // if(!empty($HTTP_CLIENT_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 .= '<option value="' . $forum_rows[$j]['forum_id'] . '"' . $selected . '>' . $forum_rows[$j]['forum_name'] . '</option>'; + + // + // 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 @@ -207,6 +207,27 @@ else } // +// Generate HTML required for Mozilla Navigation bar +// +$nav_links_html = ''; +$nav_link_proto = '<link rel="%s" href="%s" title="%s" />'."\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 <link rel='chapter'> 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 // should all S_x_ACTIONS for forms. @@ -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 @@ -<!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" --> -<!-- <html xmlns="http://www.w3.org/1999/xhtml"> --> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html" /> <meta http-equiv="Content-Style-Type" content="text/css" /> {META} +{NAV_LINKS} <title>{SITENAME} :: {PAGE_TITLE}</title> <style type="text/css"> <!-- diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index c7dc2ef986..306fce295c 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -611,6 +611,14 @@ else } // +// Mozilla navigation bar +// +$nav_links['up'] = array( + 'url' => append_sid("index.".$phpEx), + 'title' => sprintf($lang['Forum_Index'], $board_config['sitename']) +); + +// // Dump out the page header and load viewforum template // $page_title = $lang['View_forum'] . " - " . $forum_row['forum_name']; @@ -626,4 +634,4 @@ $template->pparse("body"); // include($phpbb_root_path . 'includes/page_tail.'.$phpEx); -?>
\ No newline at end of file +?> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 8641e8ec39..eaa6cd210c 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -419,14 +419,45 @@ $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); // +// Post, reply and other URL generation for +// templating vars +// +$new_topic_url = append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id"); +$reply_topic_url = append_sid("posting.$phpEx?mode=reply&" . POST_TOPIC_URL . "=$topic_id"); + +$view_forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"); + +$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=previous"); +$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=next"); + +// +// Mozilla navigation bar +// +$nav_links['prev'] = array( + 'url' => $view_prev_topic_url, + 'title' => $lang['View_previous_topic'] +); +$nav_links['next'] = array( + 'url' => $view_next_topic_url, + 'title' => $lang['View_next_topic'] +); +$nav_links['up'] = array( + 'url' => $view_forum_url, + 'title' => $forum_name +); + +$reply_img = ( $forum_row['forum_status'] == FORUM_LOCKED || $forum_row['topic_status'] == TOPIC_LOCKED ) ? $images['reply_locked'] : $images['reply_new']; +$reply_alt = ( $forum_row['forum_status'] == FORUM_LOCKED || $forum_row['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['Reply_to_topic']; +$post_img = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new']; +$post_alt = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic']; + +// // Dump out the page header and load viewtopic body template // $topic_last_read = ( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) ) ? $HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id] : 0; setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); -$page_title = $lang['View_topic'] ." - $topic_title"; -include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( "body" => "viewtopic_body.tpl", @@ -459,26 +490,13 @@ $template->assign_vars(array( "S_POST_DAYS_ACTION" => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$start")) ); -// -// End header -// + +$page_title = $lang['View_topic'] ." - $topic_title"; +include($phpbb_root_path . 'includes/page_header.'.$phpEx); // -// Post, reply and other URL generation for -// templating vars +// End header // -$new_topic_url = append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id"); -$reply_topic_url = append_sid("posting.$phpEx?mode=reply&" . POST_TOPIC_URL . "=$topic_id"); - -$view_forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"); - -$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=previous"); -$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=next"); - -$reply_img = ( $forum_row['forum_status'] == FORUM_LOCKED || $forum_row['topic_status'] == TOPIC_LOCKED ) ? $images['reply_locked'] : $images['reply_new']; -$reply_alt = ( $forum_row['forum_status'] == FORUM_LOCKED || $forum_row['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['Reply_to_topic']; -$post_img = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new']; -$post_alt = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic']; // // Censor topic title |