Skip to main content
Topic: Remove read notifications? (Read 1437 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Remove read notifications?

Could there be a way to batch remove read notifications?  If users don't manually remove them as they're read (and they won't), the database will continue filling with them, needlessly taking space.  Perhaps this should be weekly forum maintenance?

Re: Remove read notifications?

Reply #1

A better way to "detect" read notifications would be handy (e.g. mark them as read when the message is read irrespective of how the user reach the message), though nobody managed to make it become reality.
A scheduled task I guess it would work, the "main code" would be something like:
Code: [Select]
$mentions = getAllMentionIDsYouWantToMarkAsRead();
require_once(CONTROLLERDIR . '/Mentions.controller.php');
$mentions = new Mentions_Controller();
foreach ($mentions as $mention_id)
{
$mentions->setData(array(
'id_mention' => $id_mention,
'mark' => 'read',
));
$mentions->action_markread();
}
getAllMentionIDsYouWantToMarkAsRead is of course just a dummy function that require an actual implementation.
Bugs creator.
Features destroyer.
Template killer.