mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11405] Send post notifications to forum subscribers
Like in 3.0 we should also send notifications about new posts to users that subscribed to the forum. (Subscriptions are verbose) PHPBB3-11405
This commit is contained in:
parent
bc5f8e30d0
commit
a91ffe06c7
2 changed files with 16 additions and 23 deletions
|
@ -106,11 +106,26 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$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))
|
if (empty($users))
|
||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$users = array_unique($users);
|
||||||
|
sort($users);
|
||||||
|
|
||||||
$auth_read = $this->auth->acl_get_list($users, 'f_read', $post['forum_id']);
|
$auth_read = $this->auth->acl_get_list($users, 'f_read', $post['forum_id']);
|
||||||
|
|
||||||
if (empty($auth_read))
|
if (empty($auth_read))
|
||||||
|
|
|
@ -53,14 +53,7 @@ class phpbb_notification_submit_post_notifications_test extends phpbb_database_t
|
||||||
$this->greaterThan(0))
|
$this->greaterThan(0))
|
||||||
->will($this->returnValueMap(array(
|
->will($this->returnValueMap(array(
|
||||||
array(
|
array(
|
||||||
array(
|
array('3', '4', '5', '6', '7', '8',),
|
||||||
0 => '3',
|
|
||||||
1 => '4',
|
|
||||||
2 => '5',
|
|
||||||
3 => '6',
|
|
||||||
5 => '7',
|
|
||||||
6 => '8',
|
|
||||||
),
|
|
||||||
'f_read',
|
'f_read',
|
||||||
1,
|
1,
|
||||||
array(
|
array(
|
||||||
|
@ -69,21 +62,6 @@ class phpbb_notification_submit_post_notifications_test extends phpbb_database_t
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
array(
|
|
||||||
array(
|
|
||||||
0 => '3',
|
|
||||||
1 => '4',
|
|
||||||
2 => '5',
|
|
||||||
3 => '6',
|
|
||||||
),
|
|
||||||
'f_read',
|
|
||||||
1,
|
|
||||||
array(
|
|
||||||
1 => array(
|
|
||||||
'f_read' => array(3, 5, 6,),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)));
|
)));
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
|
|
Loading…
Add table
Reference in a new issue