diff options
| author | Nils Adermann <naderman@naderman.de> | 2011-08-25 23:20:55 -0400 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2011-08-25 23:20:55 -0400 |
| commit | 0d4089da7fab3c4e2f177ad62bed142d4df181e1 (patch) | |
| tree | df314f77d6f284e6bbda02998a0c57db9bf3d90c /phpBB/includes/functions_display.php | |
| parent | d602f748663ea1b726bbf2614e4d54ee5da309b1 (diff) | |
| parent | 4f8bb02a57dbc11a1c390abf7ca70fd08d8fd5c2 (diff) | |
| download | forums-0d4089da7fab3c4e2f177ad62bed142d4df181e1.tar forums-0d4089da7fab3c4e2f177ad62bed142d4df181e1.tar.gz forums-0d4089da7fab3c4e2f177ad62bed142d4df181e1.tar.bz2 forums-0d4089da7fab3c4e2f177ad62bed142d4df181e1.tar.xz forums-0d4089da7fab3c4e2f177ad62bed142d4df181e1.zip | |
Merge remote-tracking branch 'github-bantu/ticket/10320' into develop-olympus
* github-bantu/ticket/10320:
[ticket/10320] Exclude passworded forums when determining "Most active topic".
[ticket/10320] Move phpbb_feed_base::get_passworded_forums() to user class.
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 0dcfab8449..14d0c44dcf 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1008,13 +1008,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); |
