diff options
author | Andreas Fischer <bantu@phpbb.com> | 2011-08-25 17:33:39 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2011-08-25 17:33:39 +0200 |
commit | 4f8bb02a57dbc11a1c390abf7ca70fd08d8fd5c2 (patch) | |
tree | 64fb43ca3586b7687c2b51b1ef346e57e7a0a5f0 /phpBB/includes/functions_display.php | |
parent | 4491746c73700b45bc536c3a4cc90b84a07340f1 (diff) | |
download | forums-4f8bb02a57dbc11a1c390abf7ca70fd08d8fd5c2.tar forums-4f8bb02a57dbc11a1c390abf7ca70fd08d8fd5c2.tar.gz forums-4f8bb02a57dbc11a1c390abf7ca70fd08d8fd5c2.tar.bz2 forums-4f8bb02a57dbc11a1c390abf7ca70fd08d8fd5c2.tar.xz forums-4f8bb02a57dbc11a1c390abf7ca70fd08d8fd5c2.zip |
[ticket/10320] Exclude passworded forums when determining "Most active topic".
PHPBB3-10320
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r-- | phpBB/includes/functions_display.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 7982b9908d..4d66e17fe9 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -996,13 +996,17 @@ function display_user_activity(&$userdata) } // Obtain active topic + // We need to exclude passworded forums here so we do not leak the topic title + $forum_ary_topic = array_unique(array_merge($forum_ary, $user->get_passworded_forums())); + $forum_sql_topic = (!empty($forum_ary_topic)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary_topic, true) : ''; + $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts FROM ' . POSTS_TABLE . ' WHERE poster_id = ' . $userdata['user_id'] . " AND post_postcount = 1 AND (post_approved = 1 $sql_m_approve) - $forum_sql + $forum_sql_topic GROUP BY topic_id ORDER BY num_posts DESC"; $result = $db->sql_query_limit($sql, 1); |