1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/13205] Add a mark all messages read link to PM folders

PHPBB3-13205
This commit is contained in:
Nils Adermann
2014-10-22 18:02:43 -04:00
parent fad280f94b
commit 48dc4c02ae
4 changed files with 45 additions and 1 deletions

View File

@@ -914,6 +914,23 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
}
}
function mark_folder_read($user_id, $folder_id)
{
global $db;
$sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . "
WHERE folder_id = $folder_id
AND user_id = $user_id
AND pm_unread = 1";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
update_unread_status(true, $row['msg_id'], $user_id, $folder_id);
}
$db->sql_freeresult($result);
}
/**
* Handle all actions possible with marked messages
*/