Clean up and added timezone output to templates

git-svn-id: file:///svn/phpbb/trunk@193 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-04-19 21:07:47 +00:00
parent 80cca03c90
commit 895ac6e0df
3 changed files with 172 additions and 128 deletions

View file

@ -24,110 +24,134 @@
define(HEADER_INC, TRUE); define(HEADER_INC, TRUE);
// Parse and show the overall header. // Parse and show the overall header.
$template->set_filenames(array("overall_header" => "overall_header.tpl", $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']) if($userdata['session_logged_in'])
{ {
$logged_in_status = "You are logged in as <b>".$userdata["username"]."</b>."; $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 .= " [<A HREF=\"login.php?submit=logout\">Logout</A>]";
} }
else 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, // Do timezone text output
"PAGE_TITLE" => $page_title, //
"LOGIN_STATUS" => $logged_in_status, if($sys_timezone < 0)
"META_INFO" => $meta_tags, {
"L_USERNAME" => $l_username, $s_timezone = "$l_all_times GMT $sys_timezone $l_hours";
"L_PASSWORD" => $l_password, }
"L_WELCOMETO" => $l_welcometo, else if($sys_timezone == 0)
"L_REGISTER" => $l_register, {
"L_PROFILE" => $l_profile, $s_timezone = "$l_all_times GMT";
"L_SEARCH" => $l_search, }
"L_PRIVATEMSGS" => $l_privmsgs, else
"L_MEMBERLIST" => $l_memberslist, {
"L_FAQ" => $l_faq, $s_timezone = "$l_all_times GMT + $sys_timezone $l_hours";
"L_FORUM" => $l_forum, }
"L_TOPICS" => $l_topics,
"L_REPLIES" => $l_replies, $template->assign_vars(array(
"L_VIEWS" => $l_views, "SITENAME" => $sitename,
"L_POSTS" => $l_posts, "PHPEX" => $phpEx,
"L_LASTPOST" => $l_lastpost, "PHPSELF" => $PHP_SELF,
"L_MODERATOR" => $l_moderator, "L_USERNAME" => $l_username,
"L_MESSAGES" => $l_messages, "L_PASSWORD" => $l_password,
"L_POSTEDTOTAL" => $l_postedtotal, "L_WELCOMETO" => $l_welcometo,
"L_WEHAVE" => $l_wehave, "L_REGISTER" => $l_register,
"L_REGUSERS" => $l_regedusers, "L_PROFILE" => $l_profile,
"L_NEWESTUSER" => $l_newestuser, "L_SEARCH" => $l_search,
"L_BROWSING" => $l_browsing, "L_PRIVATEMSGS" => $l_privmsgs,
"L_ARECURRENTLY" => $l_arecurrently, "L_MEMBERLIST" => $l_memberslist,
"L_THEFORUMS" => $l_theforums, "L_FAQ" => $l_faq,
"L_NONEWPOSTS" => $l_nonewposts, "L_FORUM" => $l_forum,
"L_NEWPOSTS" => $l_newposts)); "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"); $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) 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, case 'index':
"TOTAL_USERS" => $total_users, $template->set_filenames(array(
"NEWEST_USER" => $newest_user, "header" => "index_header.tpl",
"NEWEST_UID" => $newest_uid, "body" => "index_body.tpl",
"USERS_BROWSING" => $users_browsing)); "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->pparse("header"); case 'viewforum':
break; $template->set_filenames(array(
"header" => "viewforum_header.tpl",
case 'viewforum': "body" => "viewforum_body.tpl",
$template->set_filenames(array("header" => "viewforum_header.tpl", "jumpbox" => "jumpbox.tpl",
"body" => "viewforum_body.tpl", "footer" => "viewforum_footer.tpl"));
"jumpbox" => "jumpbox.tpl", $jumpbox = make_jumpbox();
"footer" => "viewforum_footer.tpl")); $template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->assign_vars(array(
$jumpbox = make_jumpbox(); "JUMPBOX_LIST" => $jumpbox,
$template->assign_vars(array("JUMPBOX_LIST" => $jumpbox, "JUMPBOX_ACTION" => "viewforum.".$phpEx,
"JUMPBOX_ACTION" => "viewforum.".$phpEx, "SELECT_NAME" => POST_FORUM_URL,
"SELECT_NAME" => POST_FORUM_URL)); "FORUM_ID" => $forum_id,
"FORUM_NAME" => $forum_name,
$template->assign_var_from_handle("JUMPBOX", "jumpbox"); "MODERATORS" => $forum_moderators));
$template->pparse("header");
$template->assign_vars(array("FORUM_ID" => $forum_id, break;
"FORUM_NAME" => $forum_name,
"MODERATORS" => $forum_moderators)); case 'viewtopic':
$template->set_filenames(array(
$template->pparse("header"); "header" => "viewtopic_header.tpl",
break; "body" => "viewtopic_body.tpl",
case 'viewtopic': "jumpbox" => "jumpbox.tpl",
$template->set_filenames(array("header" => "viewtopic_header.tpl", "footer" => "viewtopic_footer.tpl"));
"body" => "viewtopic_body.tpl", $jumpbox = make_jumpbox();
"jumpbox" => "jumpbox.tpl", $template->assign_var_from_handle("JUMPBOX", "jumpbox");
"footer" => "viewtopic_footer.tpl")); $template->assign_vars(array(
$jumpbox = make_jumpbox(); "JUMPBOX_LIST" => $jumpbox,
$template->assign_vars(array("JUMPBOX_LIST" => $jumpbox, "JUMPBOX_ACTION" => "viewforum.".$phpEx,
"JUMPBOX_ACTION" => "viewforum.".$phpEx, "SELECT_NAME" => POST_FORUM_URL,
"SELECT_NAME" => POST_FORUM_URL)); "FORUM_ID" => $forum_id,
"FORUM_NAME" => $forum_name,
$template->assign_var_from_handle("JUMPBOX", "jumpbox"); "TOPIC_ID" => $topic_id,
"TOPIC_TITLE" => $topic_title,
$template->assign_vars(array("FORUM_ID" => $forum_id, "POST_FORUM_URL" => POST_FORUM_URL));
"FORUM_NAME" => $forum_name, $template->pparse("header");
"TOPIC_ID" => $topic_id, break;
"TOPIC_TITLE" => $topic_title,
"POST_FORUM_URL" => POST_FORUM_URL));
$template->pparse("header");
break;
case 'viewonline': case 'viewonline':
$template->set_filenames(array("header" => "viewonline_header.tpl", $template->set_filenames(array("header" => "viewonline_header.tpl",
@ -135,43 +159,61 @@ switch($pagetype)
"jumpbox" => "jumpbox.tpl", "jumpbox" => "jumpbox.tpl",
"footer" => "viewonline_footer.tpl")); "footer" => "viewonline_footer.tpl"));
$jumpbox = make_jumpbox(); $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, "TOTAL_USERS" => $total_users,
"POST_USER_URL" => POST_USERS_URL, "POST_USER_URL" => POST_USERS_URL,
"NEWEST_USER" => $newest_user, "NEWEST_USER" => $newest_user,
"NEWEST_UID" => $newest_uid, "NEWEST_UID" => $newest_uid));
"JUMPBOX_LIST" => $jumpbox,
"JUMPBOX_ACTION" => "viewforum.".$phpEx,
"SELECT_NAME" => POST_FORUM_URL));
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->pparse("header"); $template->pparse("header");
break; break;
case 'newtopic': case 'login':
$template->set_filenames(array("header" => "newtopic_header.tpl", $template->set_filenames(array("body" => "login_body.tpl"));
"body" => "posting_body.tpl")); break;
$template->assign_vars(array("FORUM_ID" => $forum_id,
"FORUM_NAME" => $forum_name, case 'newtopic':
"L_POSTNEWIN" => $l_postnewin)); $template->set_filenames(array(
$template->pparse("header"); "header" => "newtopic_header.tpl",
break; "body" => "posting_body.tpl"));
case 'register': $jumpbox = make_jumpbox();
if(!isset($agreed)) $template->assign_var_from_handle("JUMPBOX", "jumpbox");
{ $template->assign_vars(array(
if(!isset($coppa)) "JUMPBOX_LIST" => $jumpbox,
{ "JUMPBOX_ACTION" => "viewforum.".$phpEx,
$coppa = FALSE; "SELECT_NAME" => POST_FORUM_URL,
} "L_POSTNEWIN" => $l_postnewin,
$template->set_filenames(array("body" => "agreement.tpl")); "FORUM_ID" => $forum_id,
$template->assign_vars(array("COPPA" => $coppa)); "FORUM_NAME" => $forum_name));
} $template->pparse("header");
else break;
{
$template->set_filenames(array("body" => "profile_add_body.tpl")); case 'register':
} if(!isset($agreed))
break; {
case 'profile': if(!isset($coppa))
$template->set_filenames(array("body" => "profile_view_body.tpl")); {
$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; break;
} }

View file

@ -42,6 +42,8 @@ $l_emailaddress = "Email Address";
$l_preferences = "Preferences"; $l_preferences = "Preferences";
$l_welcometo = "Welcome to"; $l_welcometo = "Welcome to";
$l_all_times = "All times are";
$l_anonymous = "Anonymous"; // Post $l_anonymous = "Anonymous"; // Post
$l_guest = "Guest"; // Whosonline $l_guest = "Guest"; // Whosonline
$l_noposts = "No $l_posts"; $l_noposts = "No $l_posts";

View file

@ -1,11 +1,11 @@
<tr> <tr>
<td> <td align="center"><table border="0" width="100%" cellpadding="0" cellspacing="1">
<table border="0" align="center" width="100%" bgcolor="#FFFFFF" cellpadding="0" cellspacing="1"> <tr>
<tr align="left"> <td style="{font-size: 8pt;}"><img src="images/folder.gif"> = {L_NEWPOSTS}</td>
<td style="{font-size: 8pt;}"><img src="images/folder.gif"> = {L_NEWPOSTS}.<br> <td style="{font-size: 8pt;}" align="right"><b>{S_TIMEZONE}</b></td>
<img src="images/red_folder.gif"> = {L_NONEWPOSTS}.<br> </tr>
</td> <tr>
</tr> <td style="{font-size: 8pt;}"><img src="images/red_folder.gif"> = {L_NONEWPOSTS}</td>
</table> </tr>
</td> </table></td>
</tr> </tr>