mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
- Removed redundant code and unnecessary queries in forum management. #42265
- Fixed use of <b> instead of <strong> in ACP git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9344 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -183,7 +183,7 @@ class acp_forums
|
||||
$forum_perm_from = request_var('forum_perm_from', 0);
|
||||
|
||||
// Copy permissions?
|
||||
if ($forum_perm_from && !empty($forum_perm_from) && $forum_perm_from != $forum_data['forum_id'] &&
|
||||
if (!empty($forum_perm_from) && $forum_perm_from != $forum_data['forum_id'] &&
|
||||
(($action != 'edit') || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))))
|
||||
{
|
||||
// if we edit a forum delete current permissions first
|
||||
@@ -560,13 +560,12 @@ class acp_forums
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST . "
|
||||
AND forum_id <> $forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
|
||||
$postable_forum_exists = false;
|
||||
if ($db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $forum_id, false, true, false))
|
||||
);
|
||||
$postable_forum_exists = true;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
@@ -583,25 +582,24 @@ class acp_forums
|
||||
|
||||
$forums_list = make_forum_select($forum_data['parent_id'], $subforums_id);
|
||||
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST . "
|
||||
AND forum_id <> $forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($db->sql_fetchrow($result))
|
||||
if ($postable_forum_exists)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id)) // , false, true, false???
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false,
|
||||
'S_FORUMS_LIST' => $forums_list)
|
||||
);
|
||||
}
|
||||
else if ($postable_forum_exists)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $forum_id, false, true, false))
|
||||
);
|
||||
}
|
||||
|
||||
$s_show_display_on_index = false;
|
||||
|
||||
@@ -714,7 +712,7 @@ class acp_forums
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST . "
|
||||
AND forum_id <> $forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
|
||||
if ($db->sql_fetchrow($result))
|
||||
{
|
||||
@@ -807,10 +805,6 @@ class acp_forums
|
||||
|
||||
$url = $this->u_action . "&parent_id=$this->parent_id&f={$row['forum_id']}";
|
||||
|
||||
$forum_title = ($forum_type != FORUM_LINK) ? '<a href="' . $this->u_action . '&parent_id=' . $row['forum_id'] . '">' : '';
|
||||
$forum_title .= $row['forum_name'];
|
||||
$forum_title .= ($forum_type != FORUM_LINK) ? '</a>' : '';
|
||||
|
||||
$template->assign_block_vars('forums', array(
|
||||
'FOLDER_IMAGE' => $folder_image,
|
||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '',
|
||||
|
Reference in New Issue
Block a user