|
From: Bart v. B. <ba...@us...> - 2001-11-26 12:09:42
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv22343/includes
Modified Files:
functions.php page_header.php
Log Message:
Implemented Navigation bar in Mozilla
Index: functions.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions.php,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -r1.84 -r1.85
*** functions.php 2001/11/25 23:31:04 1.84
--- functions.php 2001/11/26 12:09:37 1.85
***************
*** 120,123 ****
--- 120,124 ----
{
global $lang, $db, $SID;
+ global $nav_links, $phpEx;
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
***************
*** 161,164 ****
--- 162,175 ----
$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']
+ );
+
}
}
Index: page_header.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/page_header.php,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -r1.72 -r1.73
*** page_header.php 2001/11/22 15:55:07 1.72
--- page_header.php 2001/11/26 12:09:37 1.73
***************
*** 208,211 ****
--- 208,232 ----
//
+ // 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
***************
*** 337,344 ****
"T_SPAN_CLASS1" => $theme['span_class1'],
"T_SPAN_CLASS2" => $theme['span_class2'],
! "T_SPAN_CLASS3" => $theme['span_class3'])
);
-
//
// Login box?
--- 358,366 ----
"T_SPAN_CLASS1" => $theme['span_class1'],
"T_SPAN_CLASS2" => $theme['span_class2'],
! "T_SPAN_CLASS3" => $theme['span_class3'],
!
! "NAV_LINKS" => $nav_links_html)
);
//
// Login box?
***************
*** 368,370 ****
$template->pparse("overall_header");
! ?>
\ No newline at end of file
--- 390,392 ----
$template->pparse("overall_header");
! ?>
|