aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_privmsgs.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2014-10-22 18:02:43 -0400
committerNils Adermann <naderman@naderman.de>2014-10-22 18:02:43 -0400
commit48dc4c02ae097258f8b4a9c39c38580d29b640f3 (patch)
treedde4c444dcfc2d6602fea6fe88fc4e156816c7fa /phpBB/includes/functions_privmsgs.php
parentfad280f94b97799cf12a636b65f7f2288e8b3640 (diff)
downloadforums-48dc4c02ae097258f8b4a9c39c38580d29b640f3.tar
forums-48dc4c02ae097258f8b4a9c39c38580d29b640f3.tar.gz
forums-48dc4c02ae097258f8b4a9c39c38580d29b640f3.tar.bz2
forums-48dc4c02ae097258f8b4a9c39c38580d29b640f3.tar.xz
forums-48dc4c02ae097258f8b4a9c39c38580d29b640f3.zip
[ticket/13205] Add a mark all messages read link to PM folders
PHPBB3-13205
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r--phpBB/includes/functions_privmsgs.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index ad142b1cca..79f818caf2 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -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
*/