aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-04-19 21:07:47 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-04-19 21:07:47 +0000
commit895ac6e0dfc339629497a2d165bd92297e5fe500 (patch)
treee034600a12d1f6884816f32507b22a05ce31c212 /phpBB/includes
parent80cca03c908a3f268f8746dc921fe4e4bf9f4fdd (diff)
downloadforums-895ac6e0dfc339629497a2d165bd92297e5fe500.tar
forums-895ac6e0dfc339629497a2d165bd92297e5fe500.tar.gz
forums-895ac6e0dfc339629497a2d165bd92297e5fe500.tar.bz2
forums-895ac6e0dfc339629497a2d165bd92297e5fe500.tar.xz
forums-895ac6e0dfc339629497a2d165bd92297e5fe500.zip
Clean up and added timezone output to templates
git-svn-id: file:///svn/phpbb/trunk@193 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/page_header.php274
1 files changed, 158 insertions, 116 deletions
diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php
index ae636d0e07..53dd87e3ab 100644
--- a/phpBB/includes/page_header.php
+++ b/phpBB/includes/page_header.php
@@ -24,110 +24,134 @@
define(HEADER_INC, TRUE);
-
// Parse and show the overall header.
$template->set_filenames(array("overall_header" => "overall_header.tpl",
- "overall_footer" => "overall_footer.tpl"));
+ "overall_footer" => "overall_footer.tpl"));
+//
+// Generate logged in/logged out status
+//
if($userdata['session_logged_in'])
{
- $logged_in_status = "You are logged in as <b>".$userdata["username"]."</b>.";
- $logged_in_status .= " [<A HREF=\"login.php?submit=logout\">Logout</A>]";
+ $logged_in_status = "You are logged in as <b>".$userdata["username"]."</b>.";
+ $logged_in_status .= " [<A HREF=\"login.php?submit=logout\">Logout</A>]";
}
else
{
- $logged_in_status = "You are not logged in.";
+ $logged_in_status = "You are not logged in.";
}
-$template->assign_vars(array("SITENAME" => $sitename,
- "PHPEX" => $phpEx,
- "PAGE_TITLE" => $page_title,
- "LOGIN_STATUS" => $logged_in_status,
- "META_INFO" => $meta_tags,
- "L_USERNAME" => $l_username,
- "L_PASSWORD" => $l_password,
- "L_WELCOMETO" => $l_welcometo,
- "L_REGISTER" => $l_register,
- "L_PROFILE" => $l_profile,
- "L_SEARCH" => $l_search,
- "L_PRIVATEMSGS" => $l_privmsgs,
- "L_MEMBERLIST" => $l_memberslist,
- "L_FAQ" => $l_faq,
- "L_FORUM" => $l_forum,
- "L_TOPICS" => $l_topics,
- "L_REPLIES" => $l_replies,
- "L_VIEWS" => $l_views,
- "L_POSTS" => $l_posts,
- "L_LASTPOST" => $l_lastpost,
- "L_MODERATOR" => $l_moderator,
- "L_MESSAGES" => $l_messages,
- "L_POSTEDTOTAL" => $l_postedtotal,
- "L_WEHAVE" => $l_wehave,
- "L_REGUSERS" => $l_regedusers,
- "L_NEWESTUSER" => $l_newestuser,
- "L_BROWSING" => $l_browsing,
- "L_ARECURRENTLY" => $l_arecurrently,
- "L_THEFORUMS" => $l_theforums,
- "L_NONEWPOSTS" => $l_nonewposts,
- "L_NEWPOSTS" => $l_newposts));
+//
+// Do timezone text output
+//
+if($sys_timezone < 0)
+{
+ $s_timezone = "$l_all_times GMT $sys_timezone $l_hours";
+}
+else if($sys_timezone == 0)
+{
+ $s_timezone = "$l_all_times GMT";
+}
+else
+{
+ $s_timezone = "$l_all_times GMT + $sys_timezone $l_hours";
+}
+
+$template->assign_vars(array(
+ "SITENAME" => $sitename,
+ "PHPEX" => $phpEx,
+ "PHPSELF" => $PHP_SELF,
+ "L_USERNAME" => $l_username,
+ "L_PASSWORD" => $l_password,
+ "L_WELCOMETO" => $l_welcometo,
+ "L_REGISTER" => $l_register,
+ "L_PROFILE" => $l_profile,
+ "L_SEARCH" => $l_search,
+ "L_PRIVATEMSGS" => $l_privmsgs,
+ "L_MEMBERLIST" => $l_memberslist,
+ "L_FAQ" => $l_faq,
+ "L_FORUM" => $l_forum,
+ "L_TOPICS" => $l_topics,
+ "L_REPLIES" => $l_replies,
+ "L_VIEWS" => $l_views,
+ "L_POSTS" => $l_posts,
+ "L_LASTPOST" => $l_lastpost,
+ "L_MODERATOR" => $l_moderator,
+ "L_MESSAGES" => $l_messages,
+ "L_POSTEDTOTAL" => $l_postedtotal,
+ "L_WEHAVE" => $l_wehave,
+ "L_REGUSERS" => $l_regedusers,
+ "L_NEWESTUSER" => $l_newestuser,
+ "L_BROWSING" => $l_browsing,
+ "L_ARECURRENTLY" => $l_arecurrently,
+ "L_THEFORUMS" => $l_theforums,
+ "L_NONEWPOSTS" => $l_nonewposts,
+ "L_NEWPOSTS" => $l_newposts,
+ "S_TIMEZONE" => $s_timezone,
+ "PAGE_TITLE" => $page_title,
+ "LOGIN_STATUS" => $logged_in_status,
+ "META_INFO" => $meta_tags));
$template->pparse("overall_header");
-// Do a switch on page type, this way we only load the templates that we need at the time
+//
+// Do a switch on page type, this way we only load
+// the templates that we need at the time
+//
switch($pagetype)
{
- case 'index':
- $template->set_filenames(array("header" => "index_header.tpl",
- "body" => "index_body.tpl",
- "footer" => "index_footer.tpl"));
-
- $template->assign_vars(array("TOTAL_POSTS" => $total_posts,
- "TOTAL_USERS" => $total_users,
- "NEWEST_USER" => $newest_user,
- "NEWEST_UID" => $newest_uid,
- "USERS_BROWSING" => $users_browsing));
-
- $template->pparse("header");
- break;
-
- case 'viewforum':
- $template->set_filenames(array("header" => "viewforum_header.tpl",
- "body" => "viewforum_body.tpl",
- "jumpbox" => "jumpbox.tpl",
- "footer" => "viewforum_footer.tpl"));
- $jumpbox = make_jumpbox();
- $template->assign_vars(array("JUMPBOX_LIST" => $jumpbox,
- "JUMPBOX_ACTION" => "viewforum.".$phpEx,
- "SELECT_NAME" => POST_FORUM_URL));
-
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
-
- $template->assign_vars(array("FORUM_ID" => $forum_id,
- "FORUM_NAME" => $forum_name,
- "MODERATORS" => $forum_moderators));
-
- $template->pparse("header");
- break;
- case 'viewtopic':
- $template->set_filenames(array("header" => "viewtopic_header.tpl",
- "body" => "viewtopic_body.tpl",
- "jumpbox" => "jumpbox.tpl",
- "footer" => "viewtopic_footer.tpl"));
- $jumpbox = make_jumpbox();
- $template->assign_vars(array("JUMPBOX_LIST" => $jumpbox,
- "JUMPBOX_ACTION" => "viewforum.".$phpEx,
- "SELECT_NAME" => POST_FORUM_URL));
-
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ case 'index':
+ $template->set_filenames(array(
+ "header" => "index_header.tpl",
+ "body" => "index_body.tpl",
+ "footer" => "index_footer.tpl"));
+ $template->assign_vars(array(
+ "TOTAL_POSTS" => $total_posts,
+ "TOTAL_USERS" => $total_users,
+ "NEWEST_USER" => $newest_user,
+ "NEWEST_UID" => $newest_uid,
+ "USERS_BROWSING" => $users_browsing));
+ $template->pparse("header");
+ break;
- $template->assign_vars(array("FORUM_ID" => $forum_id,
- "FORUM_NAME" => $forum_name,
- "TOPIC_ID" => $topic_id,
- "TOPIC_TITLE" => $topic_title,
- "POST_FORUM_URL" => POST_FORUM_URL));
- $template->pparse("header");
- break;
+ case 'viewforum':
+ $template->set_filenames(array(
+ "header" => "viewforum_header.tpl",
+ "body" => "viewforum_body.tpl",
+ "jumpbox" => "jumpbox.tpl",
+ "footer" => "viewforum_footer.tpl"));
+ $jumpbox = make_jumpbox();
+ $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ $template->assign_vars(array(
+ "JUMPBOX_LIST" => $jumpbox,
+ "JUMPBOX_ACTION" => "viewforum.".$phpEx,
+ "SELECT_NAME" => POST_FORUM_URL,
+ "FORUM_ID" => $forum_id,
+ "FORUM_NAME" => $forum_name,
+ "MODERATORS" => $forum_moderators));
+ $template->pparse("header");
+ break;
+
+ case 'viewtopic':
+ $template->set_filenames(array(
+ "header" => "viewtopic_header.tpl",
+ "body" => "viewtopic_body.tpl",
+ "jumpbox" => "jumpbox.tpl",
+ "footer" => "viewtopic_footer.tpl"));
+ $jumpbox = make_jumpbox();
+ $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ $template->assign_vars(array(
+ "JUMPBOX_LIST" => $jumpbox,
+ "JUMPBOX_ACTION" => "viewforum.".$phpEx,
+ "SELECT_NAME" => POST_FORUM_URL,
+ "FORUM_ID" => $forum_id,
+ "FORUM_NAME" => $forum_name,
+ "TOPIC_ID" => $topic_id,
+ "TOPIC_TITLE" => $topic_title,
+ "POST_FORUM_URL" => POST_FORUM_URL));
+ $template->pparse("header");
+ break;
case 'viewonline':
$template->set_filenames(array("header" => "viewonline_header.tpl",
@@ -135,43 +159,61 @@ switch($pagetype)
"jumpbox" => "jumpbox.tpl",
"footer" => "viewonline_footer.tpl"));
$jumpbox = make_jumpbox();
- $template->assign_vars(array("TOTAL_POSTS" => $total_posts,
+ $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ $template->assign_vars(array(
+ "JUMPBOX_LIST" => $jumpbox,
+ "JUMPBOX_ACTION" => "viewforum.".$phpEx,
+ "SELECT_NAME" => POST_FORUM_URL,
+ "TOTAL_POSTS" => $total_posts,
"TOTAL_USERS" => $total_users,
"POST_USER_URL" => POST_USERS_URL,
"NEWEST_USER" => $newest_user,
- "NEWEST_UID" => $newest_uid,
+ "NEWEST_UID" => $newest_uid));
+ $template->pparse("header");
+ break;
+
+ case 'login':
+ $template->set_filenames(array("body" => "login_body.tpl"));
+ break;
+
+ case 'newtopic':
+ $template->set_filenames(array(
+ "header" => "newtopic_header.tpl",
+ "body" => "posting_body.tpl"));
+ $jumpbox = make_jumpbox();
+ $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ $template->assign_vars(array(
"JUMPBOX_LIST" => $jumpbox,
"JUMPBOX_ACTION" => "viewforum.".$phpEx,
- "SELECT_NAME" => POST_FORUM_URL));
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ "SELECT_NAME" => POST_FORUM_URL,
+ "L_POSTNEWIN" => $l_postnewin,
+ "FORUM_ID" => $forum_id,
+ "FORUM_NAME" => $forum_name));
$template->pparse("header");
break;
- case 'newtopic':
- $template->set_filenames(array("header" => "newtopic_header.tpl",
- "body" => "posting_body.tpl"));
- $template->assign_vars(array("FORUM_ID" => $forum_id,
- "FORUM_NAME" => $forum_name,
- "L_POSTNEWIN" => $l_postnewin));
- $template->pparse("header");
- break;
- case 'register':
- if(!isset($agreed))
- {
- if(!isset($coppa))
- {
- $coppa = FALSE;
- }
- $template->set_filenames(array("body" => "agreement.tpl"));
- $template->assign_vars(array("COPPA" => $coppa));
- }
- else
- {
- $template->set_filenames(array("body" => "profile_add_body.tpl"));
- }
- break;
- case 'profile':
- $template->set_filenames(array("body" => "profile_view_body.tpl"));
+ case 'register':
+ if(!isset($agreed))
+ {
+ if(!isset($coppa))
+ {
+ $coppa = FALSE;
+ }
+ $template->set_filenames(array(
+ "body" => "agreement.tpl"));
+ $template->assign_vars(array(
+ "COPPA" => $coppa));
+ }
+ else
+ {
+ $template->set_filenames(array(
+ "body" => "profile_add_body.tpl"));
+ }
+ break;
+
+ case 'profile':
+ $template->set_filenames(array(
+ "body" => "profile_view_body.tpl"));
break;
}