From e1cf8fd13c1030b0a1ee5d2e25bac48bd89e8f18 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 7 Jun 2006 18:12:38 +0000 Subject: [PATCH] fix bug #2086 remove cached sql results for moderator cache table if re-applying moderators git-svn-id: file:///svn/phpbb/trunk@6019 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 3 +++ phpBB/includes/functions_display.php | 7 +++++-- phpBB/styles/subSilver/template/viewforum_body.html | 2 +- phpBB/viewforum.php | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 91cd9cd05c..053449c528 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1872,6 +1872,9 @@ function cache_moderators() { global $db, $cache, $auth, $phpbb_root_path, $phpEx; + // Remove cached sql results + $cache->destroy('sql', MODERATOR_TABLE); + // Clear table $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . MODERATOR_TABLE); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index aa91e4d761..b0d1b03809 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -147,6 +147,11 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod // if ($row['parent_id'] == $root_data['forum_id'] || $row['parent_id'] == $branch_root_id) { + if ($row['forum_type'] != FORUM_CAT) + { + $forum_ids_moderator[] = $forum_id; + } + // Direct child of current branch $parent_id = $forum_id; $forum_rows[$forum_id] = $row; @@ -185,8 +190,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id; } } - - $forum_ids_moderator[$parent_id] = $forum_rows[$parent_id]['forum_id_last_post']; } $db->sql_freeresult($result); diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index 3c8a6417db..71b6194620 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -92,7 +92,7 @@

{FORUM_NAME}

-

{L_MODERATORS}: {MODERATORS}

+

{L_MODERATOR}{L_MODERATORS}: {MODERATORS}

[ {L_MCP} ]

diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 41e4b0257f..a45f458db4 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -271,6 +271,7 @@ $template->assign_vars(array( 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start"), 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false, 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'fid[]=' . $forum_id), + 'S_SINGLE_MODERATOR' => (!empty($moderators[$forum_id]) && sizeof($moderators[$forum_id]) > 1) ? false : true, 'U_MCP' => ($auth->acl_gets('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', 'U_POST_NEW_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id),