diff options
| author | David King <imkingdavid@gmail.com> | 2013-09-12 22:01:11 -0700 |
|---|---|---|
| committer | David King <imkingdavid@gmail.com> | 2013-09-12 22:01:11 -0700 |
| commit | fc7a35be38caa52df29b7126a57d461efd5a5d06 (patch) | |
| tree | f4c859e9e29f685276e6273f83799d6afafe5ab8 /phpBB/phpbb/notification | |
| parent | 5925ea1f4584d66f0c613a36389234a331a964a8 (diff) | |
| parent | f723491527f7f50b8f85d6385696992916468511 (diff) | |
| download | forums-fc7a35be38caa52df29b7126a57d461efd5a5d06.tar forums-fc7a35be38caa52df29b7126a57d461efd5a5d06.tar.gz forums-fc7a35be38caa52df29b7126a57d461efd5a5d06.tar.bz2 forums-fc7a35be38caa52df29b7126a57d461efd5a5d06.tar.xz forums-fc7a35be38caa52df29b7126a57d461efd5a5d06.zip | |
Merge pull request #1622 from EXreaction/ticket/11373
[ticket/11373] Prune old read notifications with cron
Diffstat (limited to 'phpBB/phpbb/notification')
| -rw-r--r-- | phpBB/phpbb/notification/manager.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index acfc984ddc..a962a61e6e 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -797,11 +797,13 @@ class phpbb_notification_manager * Delete all notifications older than a certain time * * @param int $timestamp Unix timestamp to delete all notifications that were created before + * @param bool $only_unread True (default) to only prune read notifications */ - public function prune_notifications($timestamp) + public function prune_notifications($timestamp, $only_read = true) { $sql = 'DELETE FROM ' . $this->notifications_table . ' - WHERE notification_time < ' . (int) $timestamp; + WHERE notification_time < ' . (int) $timestamp . + (($only_read) ? ' AND notification_read = 1' : ''); $this->db->sql_query($sql); } |
