1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 12:14:06 +02:00

New template system. Lots of merging conflicts, so let nate know if he broke stuff.

git-svn-id: file:///svn/phpbb/trunk@105 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
natec
2001-03-17 00:46:26 +00:00
parent b1ce902c02
commit 40f1f172a8
12 changed files with 476 additions and 438 deletions

View File

@@ -23,7 +23,7 @@
***************************************************************************/
// Parse and show the overall header.
$template->set_file(array("overall_header" => "overall_header.tpl",
$template->set_filenames(array("overall_header" => "overall_header.tpl",
"overall_footer" => "overall_footer.tpl"));
if($user_logged_in)
@@ -35,7 +35,7 @@ else
$logged_in_status = "You are not logged in.";
}
$template->set_var(array("SITENAME" => $sitename,
$template->assign_vars(array("SITENAME" => $sitename,
"PHPEX" => $phpEx,
"PAGE_TITLE" => $page_title,
"LOGIN_STATUS" => $logged_in_status,
@@ -67,67 +67,69 @@ $template->set_var(array("SITENAME" => $sitename,
"L_NONEWPOSTS" => $l_nonewposts,
"L_NEWPOSTS" => $l_newposts));
$template->pparse("output", "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
switch($pagetype)
{
case 'index':
$template->set_file(array("header" => "index_header.tpl",
$template->set_filenames(array("header" => "index_header.tpl",
"body" => "index_body.tpl",
"footer" => "index_footer.tpl"));
$template->set_var(array("TOTAL_POSTS" => $total_posts,
$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("output", "header");
$template->pparse("header");
break;
case 'viewforum':
$template->set_file(array("header" => "viewforum_header.tpl",
$template->set_filenames(array("header" => "viewforum_header.tpl",
"body" => "viewforum_body.tpl",
"jumpbox" => "jumpbox.tpl",
"footer" => "viewforum_footer.tpl"));
$jumpbox = make_jumpbox($db);
$template->set_var(array("JUMPBOX_LIST" => $jumpbox,
$template->assign_vars(array("JUMPBOX_LIST" => $jumpbox,
"JUMPBOX_ACTION" => "viewforum.".$phpEx,
"SELECT_NAME" => "forum_id"));
$template->parse("JUMPBOX","jumpbox");
$template->set_var(array("FORUM_ID" => $forum_id,
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->assign_vars(array("FORUM_ID" => $forum_id,
"FORUM_NAME" => $forum_name,
"MODERATORS" => $forum_moderators));
$template->pparse("output", "header");
$template->pparse("header");
break;
case 'viewtopic':
$template->set_file(array("header" => "viewtopic_header.tpl",
$template->set_filenames(array("header" => "viewtopic_header.tpl",
"body" => "viewtopic_body.tpl",
"jumpbox" => "jumpbox.tpl",
"footer" => "viewtopic_footer.tpl"));
$jumpbox = make_jumpbox($db);
$template->set_var(array("JUMPBOX_LIST" => $jumpbox,
$template->assign_vars(array("JUMPBOX_LIST" => $jumpbox,
"JUMPBOX_ACTION" => "viewforum.".$phpEx,
"SELECT_NAME" => "forum_id"));
$template->parse("JUMPBOX","jumpbox");
$template->set_var(array("FORUM_ID" => $forum_id,
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->assign_vars(array("FORUM_ID" => $forum_id,
"FORUM_NAME" => $forum_name,
"TOPIC_ID" => $topic_id,
"TOPIC_TITLE" => $topic_title));
$template->pparse("output", "header");
$template->pparse("header");
break;
case 'newtopic':
$template->set_file(array("header" => "newtopic_header.tpl",
$template->set_filenames(array("header" => "newtopic_header.tpl",
"body" => "posting_body.tpl"));
$template->set_var(array("FORUM_ID" => $forum_id,
$template->assign_vars(array("FORUM_ID" => $forum_id,
"FORUM_NAME" => $forum_name,
"L_POSTNEWIN" => $l_postnewin));
$template->pparse("output", "header");
$template->pparse("header");
break;
}