aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-06-20 22:45:16 +0200
committerAndreas Fischer <bantu@phpbb.com>2010-06-20 22:45:16 +0200
commit6b1f7a2d9d55604b1b1325932306be08177aabea (patch)
tree74ecc8c24bf0da50279c25a65d22cecf0ad4eceb /phpBB/includes/functions_display.php
parent6d248097e5422bf769fb3756e64e36e243865f79 (diff)
parente66c089626eb1bd24751893778b04c941dcf1cf8 (diff)
downloadforums-6b1f7a2d9d55604b1b1325932306be08177aabea.tar
forums-6b1f7a2d9d55604b1b1325932306be08177aabea.tar.gz
forums-6b1f7a2d9d55604b1b1325932306be08177aabea.tar.bz2
forums-6b1f7a2d9d55604b1b1325932306be08177aabea.tar.xz
forums-6b1f7a2d9d55604b1b1325932306be08177aabea.zip
Merge branch 'ticket/bantu/9112' into develop-olympus
* ticket/bantu/9112: [ticket/9112] Make sure current user can see most active forum/topic.
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index ec348138f5..5e6239b070 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -969,11 +969,16 @@ function display_user_activity(&$userdata)
$forum_ary = array_unique($forum_ary);
$forum_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary, true) : '';
+ $fid_m_approve = $auth->acl_getf('m_approve', true);
+ $sql_m_approve = (!empty($fid_m_approve)) ? 'OR ' . $db->sql_in_set('forum_id', array_keys($fid_m_approve)) : '';
+
// Obtain active forum
$sql = 'SELECT forum_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
GROUP BY forum_id
ORDER BY num_posts DESC";
@@ -996,6 +1001,8 @@ function display_user_activity(&$userdata)
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $userdata['user_id'] . "
AND post_postcount = 1
+ AND (post_approved = 1
+ $sql_m_approve)
$forum_sql
GROUP BY topic_id
ORDER BY num_posts DESC";