mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-15 13:34:41 +01:00
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
This commit is contained in:
parent
5232ded67e
commit
e1cf8fd13c
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -92,7 +92,7 @@
|
||||
<h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
|
||||
|
||||
<!-- IF MODERATORS -->
|
||||
<p class="moderators">{L_MODERATORS}: {MODERATORS}</p>
|
||||
<p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF U_MCP -->
|
||||
<p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user