mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge pull request #1316 from nickvergessen/ticket/11405
Ticket/11405 Users that are subscribed to a forum, should receive notifications for new replies
This commit is contained in:
@@ -89,6 +89,7 @@ class phpbb_notification_type_bookmark extends phpbb_notification_type_post
|
||||
{
|
||||
return array();
|
||||
}
|
||||
sort($users);
|
||||
|
||||
$auth_read = $this->auth->acl_get_list($users, 'f_read', $post['forum_id']);
|
||||
|
||||
|
@@ -106,11 +106,26 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT user_id
|
||||
FROM ' . FORUMS_WATCH_TABLE . '
|
||||
WHERE forum_id = ' . (int) $post['forum_id'] . '
|
||||
AND notify_status = ' . NOTIFY_YES . '
|
||||
AND user_id <> ' . (int) $post['poster_id'];
|
||||
$result = $this->db->sql_query($sql);
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$users[] = $row['user_id'];
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
if (empty($users))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$users = array_unique($users);
|
||||
sort($users);
|
||||
|
||||
$auth_read = $this->auth->acl_get_list($users, 'f_read', $post['forum_id']);
|
||||
|
||||
if (empty($auth_read))
|
||||
|
@@ -82,7 +82,7 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post
|
||||
'ignore_users' => array(),
|
||||
), $options);
|
||||
|
||||
// 0 is for global
|
||||
// 0 is for global moderator permissions
|
||||
$auth_approve = $this->auth->acl_get_list(false, $this->permission, array($post['forum_id'], 0));
|
||||
|
||||
if (empty($auth_approve))
|
||||
@@ -101,8 +101,15 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post
|
||||
{
|
||||
$has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission]));
|
||||
}
|
||||
sort($has_permission);
|
||||
|
||||
return $this->check_user_notification_options($has_permission, array_merge($options, array(
|
||||
$auth_read = $this->auth->acl_get_list($has_permission, 'f_read', $post['forum_id']);
|
||||
if (empty($auth_read))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
return $this->check_user_notification_options($auth_read[$post['forum_id']]['f_read'], array_merge($options, array(
|
||||
'item_type' => self::$notification_option['id'],
|
||||
)));
|
||||
}
|
||||
|
@@ -108,6 +108,7 @@ class phpbb_notification_type_quote extends phpbb_notification_type_post
|
||||
{
|
||||
return array();
|
||||
}
|
||||
sort($users);
|
||||
|
||||
$auth_read = $this->auth->acl_get_list($users, 'f_read', $post['forum_id']);
|
||||
|
||||
|
@@ -82,7 +82,7 @@ class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_top
|
||||
'ignore_users' => array(),
|
||||
), $options);
|
||||
|
||||
// 0 is for global
|
||||
// 0 is for global moderator permissions
|
||||
$auth_approve = $this->auth->acl_get_list(false, 'm_approve', array($topic['forum_id'], 0));
|
||||
|
||||
if (empty($auth_approve))
|
||||
@@ -101,8 +101,15 @@ class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_top
|
||||
{
|
||||
$has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission]));
|
||||
}
|
||||
sort($has_permission);
|
||||
|
||||
return $this->check_user_notification_options($has_permission, array_merge($options, array(
|
||||
$auth_read = $this->auth->acl_get_list($has_permission, 'f_read', $topic['forum_id']);
|
||||
if (empty($auth_read))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
return $this->check_user_notification_options($auth_read[$topic['forum_id']]['f_read'], array_merge($options, array(
|
||||
'item_type' => self::$notification_option['id'],
|
||||
)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user