mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-14 20:50:30 +01:00
Implemented Navigation bar in Mozilla
git-svn-id: file:///svn/phpbb/trunk@1452 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
dabc3a4b84
commit
8e50e5eb4e
@ -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
|
||||
//
|
||||
|
@ -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']
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -206,6 +206,27 @@ else
|
||||
$s_privmsg_new = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
@ -336,9 +357,10 @@ $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?
|
||||
|
@ -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">
|
||||
<!--
|
||||
|
@ -610,6 +610,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
|
||||
//
|
||||
|
@ -418,6 +418,39 @@ $orig_word = array();
|
||||
$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
|
||||
//
|
||||
@ -425,8 +458,6 @@ $topic_last_read = ( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topi
|
||||
|
||||
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,27 +490,14 @@ $template->assign_vars(array(
|
||||
"S_POST_DAYS_ACTION" => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$start"))
|
||||
|
||||
);
|
||||
|
||||
$page_title = $lang['View_topic'] ." - $topic_title";
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
//
|
||||
// End header
|
||||
//
|
||||
|
||||
//
|
||||
// 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");
|
||||
|
||||
$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
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user