mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-01 20:19:13 +02:00
Merge branch 'ticket/bantu/9112' into develop-olympus
* ticket/bantu/9112: [ticket/9112] Make sure current user can see most active forum/topic.
This commit is contained in:
commit
6b1f7a2d9d
@ -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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user