mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
Move jumpbox to separate template
git-svn-id: file:///svn/phpbb/trunk@67 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
cb964c96c7
commit
ad9d4d2605
4 changed files with 50 additions and 44 deletions
|
@ -34,6 +34,7 @@ else
|
|||
{
|
||||
$logged_in_status = "You are not logged in.";
|
||||
}
|
||||
|
||||
$template->set_var(array("SITENAME" => $sitename,
|
||||
"PHPEX" => $phpEx,
|
||||
"PAGE_TITLE" => $page_title,
|
||||
|
@ -44,29 +45,38 @@ $template->pparse("output", "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",
|
||||
"body" => "index_body.tpl",
|
||||
"footer" => "index_footer.tpl"));
|
||||
|
||||
$template->set_var(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");
|
||||
|
||||
break;
|
||||
case 'viewforum':
|
||||
$template->set_file(array("header" => "viewforum_header.tpl",
|
||||
"body" => "viewforum_body.tpl",
|
||||
"footer" => "viewforum_footer.tpl"));
|
||||
$template->set_var(array("FORUM_ID" => $forum_id,
|
||||
"FORUM_NAME" => $forum_name,
|
||||
"MODERATORS" => $forum_moderators));
|
||||
$template->pparse("output", "header");
|
||||
break;
|
||||
case 'index':
|
||||
$template->set_file(array("header" => "index_header.tpl",
|
||||
"body" => "index_body.tpl",
|
||||
"footer" => "index_footer.tpl"));
|
||||
|
||||
$template->set_var(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");
|
||||
break;
|
||||
|
||||
case 'viewforum':
|
||||
$template->set_file(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,
|
||||
"JUMPBOX_ACTION" => "viewforum.".$phpEx,
|
||||
"SELECT_NAME" => "forum_id"));
|
||||
$template->parse("JUMPBOX","jumpbox");
|
||||
|
||||
$template->set_var(array("FORUM_ID" => $forum_id,
|
||||
"FORUM_NAME" => $forum_name,
|
||||
"MODERATORS" => $forum_moderators));
|
||||
|
||||
$template->pparse("output", "header");
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -25,18 +25,16 @@
|
|||
// Load/parse the footer template we need based on pagetype.
|
||||
switch($pagetype)
|
||||
{
|
||||
case 'index':
|
||||
$template->pparse("output", "footer");
|
||||
break;
|
||||
case 'viewforum':
|
||||
$jumpbox = make_jumpbox($db);
|
||||
$template->set_var(array("PHPEX" => $phpEx,
|
||||
"FORUM_ID" => $forum_id,
|
||||
"SELECT_NAME" => "forum_id",
|
||||
"JUMPBOX_ACTION" => "viewforum.".$phpEx,
|
||||
"JUMPBOX_LIST" => $jumpbox));
|
||||
$template->pparse("output", "footer");
|
||||
break;
|
||||
case 'index':
|
||||
$template->pparse("output", "footer");
|
||||
break;
|
||||
|
||||
case 'viewforum':
|
||||
|
||||
$template->set_var(array("PHPEX" => $phpEx,
|
||||
"FORUM_ID" => $forum_id));
|
||||
$template->pparse("output", "footer");
|
||||
break;
|
||||
}
|
||||
|
||||
// Show the overall footer.
|
||||
|
|
5
phpBB/templates/Default/jumpbox.tpl
Normal file
5
phpBB/templates/Default/jumpbox.tpl
Normal file
|
@ -0,0 +1,5 @@
|
|||
<table cellspacing="0" cellpadding="0" border="0">
|
||||
<tr><form method="POST" action="{JUMPBOX_ACTION}">
|
||||
<td nowrap>Jump To:<select name="{SELECT_NAME}"><option value="-1">Select A Forum</option>{JUMPBOX_LIST}</select><input type="submit" value="Go"></td>
|
||||
</form></tr>
|
||||
</table>
|
|
@ -23,15 +23,8 @@
|
|||
<tr>
|
||||
<td>
|
||||
<table border="0" width="100%" bgcolor="#CCCCCC" cellpadding="1" cellspacing="1">
|
||||
<tr>
|
||||
<td align="right" style="{font-size: 8pt; height: 55px;}"><table cellspacing="0" cellpadding="0" border="0">
|
||||
<tr><form method="POST" action="{JUMPBOX_ACTION}">
|
||||
<td>Jump To:<select name="{SELECT_NAME}"><option value="-1">Select A Forum</option>
|
||||
{JUMPBOX_LIST}
|
||||
</select>
|
||||
<input type="submit" value="Go"></td>
|
||||
</form></tr>
|
||||
</table></td>
|
||||
<tr>
|
||||
<td align="right" style="{font-size: 8pt; height: 55px;}">{JUMPBOX}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
|
Loading…
Add table
Reference in a new issue