mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Minor bugfix (subforums template was called even if there only were empty subcats).
Jumpbox got its "Select a forum" entry back. git-svn-id: file:///svn/phpbb/trunk@2952 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
58ddae0c90
commit
1e52eafc80
2 changed files with 13 additions and 4 deletions
|
@ -186,7 +186,7 @@ function make_jumpbox($action, $forum_id = false)
|
||||||
{
|
{
|
||||||
global $auth, $template, $lang, $db, $nav_links, $phpEx;
|
global $auth, $template, $lang, $db, $nav_links, $phpEx;
|
||||||
|
|
||||||
$boxstring = '<select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }">';
|
$boxstring = '<select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $lang['Select_forum'] . '</option>';
|
||||||
|
|
||||||
$sql = 'SELECT forum_id, forum_name, forum_status, left_id, right_id
|
$sql = 'SELECT forum_id, forum_name, forum_status, left_id, right_id
|
||||||
FROM ' . FORUMS_TABLE . '
|
FROM ' . FORUMS_TABLE . '
|
||||||
|
@ -209,7 +209,7 @@ function make_jumpbox($action, $forum_id = false)
|
||||||
|
|
||||||
$right = $row['right_id'];
|
$right = $row['right_id'];
|
||||||
|
|
||||||
$linefeed = FALSE;
|
$linefeed = TRUE;
|
||||||
if ( ( $auth->acl_get('f_list', $forum_id) || $auth->acl_get('a_') ))
|
if ( ( $auth->acl_get('f_list', $forum_id) || $auth->acl_get('a_') ))
|
||||||
{
|
{
|
||||||
if ($row['forum_status'] == ITEM_CATEGORY)
|
if ($row['forum_status'] == ITEM_CATEGORY)
|
||||||
|
@ -256,7 +256,6 @@ function make_jumpbox($action, $forum_id = false)
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_GO' => $lang['Go'],
|
'L_GO' => $lang['Go'],
|
||||||
'L_JUMP_TO' => $lang['Jump_to'],
|
'L_JUMP_TO' => $lang['Jump_to'],
|
||||||
'L_SELECT_FORUM' => $lang['Select_forum'],
|
|
||||||
|
|
||||||
'S_JUMPBOX_SELECT' => $boxstring,
|
'S_JUMPBOX_SELECT' => $boxstring,
|
||||||
'S_JUMPBOX_ACTION' => $action)
|
'S_JUMPBOX_ACTION' => $action)
|
||||||
|
|
|
@ -96,6 +96,7 @@ if (!$auth->acl_get('f_read', $forum_id))
|
||||||
$type = 'parent';
|
$type = 'parent';
|
||||||
$forum_rows = array();
|
$forum_rows = array();
|
||||||
|
|
||||||
|
$s_has_subforums = FALSE;
|
||||||
foreach ($forum_branch as $row)
|
foreach ($forum_branch as $row)
|
||||||
{
|
{
|
||||||
if ($type == 'parent')
|
if ($type == 'parent')
|
||||||
|
@ -133,12 +134,21 @@ foreach ($forum_branch as $row)
|
||||||
{
|
{
|
||||||
$branch_root_id = $row['forum_id'];
|
$branch_root_id = $row['forum_id'];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$s_has_subforums = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif ($row['parent_id'] == $branch_root_id)
|
elseif ($row['parent_id'] == $branch_root_id)
|
||||||
{
|
{
|
||||||
// Forum directly under a category
|
// Forum directly under a category
|
||||||
$forum_rows[] = $row;
|
$forum_rows[] = $row;
|
||||||
$parent_id = $row['forum_id'];
|
$parent_id = $row['forum_id'];
|
||||||
|
|
||||||
|
if ($row['forum_status'] != ITEM_CATEGORY)
|
||||||
|
{
|
||||||
|
$s_has_subforums = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif ($row['forum_status'] != ITEM_CATEGORY)
|
elseif ($row['forum_status'] != ITEM_CATEGORY)
|
||||||
{
|
{
|
||||||
|
@ -337,7 +347,7 @@ $template->assign_vars(array(
|
||||||
//
|
//
|
||||||
// Do we have subforums? if so, let's include this harmless file
|
// Do we have subforums? if so, let's include this harmless file
|
||||||
//
|
//
|
||||||
if (count($forum_rows))
|
if ($s_has_subforums)
|
||||||
{
|
{
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_HAS_SUBFORUM' => TRUE,
|
'S_HAS_SUBFORUM' => TRUE,
|
||||||
|
|
Loading…
Add table
Reference in a new issue