aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/notification
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-10-29 23:20:59 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2012-10-29 23:20:59 -0500
commit6c213bd5fa4f93875e7771edbf519990580286c4 (patch)
tree98c0ba4082939b96e50c1b0df76acb181808904c /phpBB/includes/notification
parentead1d92b22433d26aba1d3a1356797a9104d684b (diff)
downloadforums-6c213bd5fa4f93875e7771edbf519990580286c4.tar
forums-6c213bd5fa4f93875e7771edbf519990580286c4.tar.gz
forums-6c213bd5fa4f93875e7771edbf519990580286c4.tar.bz2
forums-6c213bd5fa4f93875e7771edbf519990580286c4.tar.xz
forums-6c213bd5fa4f93875e7771edbf519990580286c4.zip
[ticket/11103] Make sure post/topic approved notifications are always unread
PHPBB3-11103
Diffstat (limited to 'phpBB/includes/notification')
-rw-r--r--phpBB/includes/notification/type/approve_post.php20
-rw-r--r--phpBB/includes/notification/type/approve_topic.php20
2 files changed, 40 insertions, 0 deletions
diff --git a/phpBB/includes/notification/type/approve_post.php b/phpBB/includes/notification/type/approve_post.php
index 60b66fd4f6..d79bc6ae13 100644
--- a/phpBB/includes/notification/type/approve_post.php
+++ b/phpBB/includes/notification/type/approve_post.php
@@ -79,6 +79,26 @@ class phpbb_notification_type_approve_post extends phpbb_notification_type_post
}
/**
+ * Pre create insert array function
+ * This allows you to perform certain actions, like run a query
+ * and load data, before create_insert_array() is run. The data
+ * returned from this function will be sent to create_insert_array().
+ *
+ * @param array $post Post data from submit_post
+ * @param array $notify_users Notify users list
+ * Formated from find_users_for_notification()
+ * @return array Whatever you want to send to create_insert_array().
+ */
+ public function pre_create_insert_array($post, $notify_users)
+ {
+ // In the parent class, this is used to check if the post is already
+ // read by a user and marks the notification read if it was marked read.
+ // Returning an empty array in effect, forces it to be marked as unread
+ // (and also saves a query)
+ return array();
+ }
+
+ /**
* Function for preparing the data for insertion in an SQL query
* (The service handles insertion)
*
diff --git a/phpBB/includes/notification/type/approve_topic.php b/phpBB/includes/notification/type/approve_topic.php
index 4fd247a789..605965bf2f 100644
--- a/phpBB/includes/notification/type/approve_topic.php
+++ b/phpBB/includes/notification/type/approve_topic.php
@@ -79,6 +79,26 @@ class phpbb_notification_type_approve_topic extends phpbb_notification_type_topi
}
/**
+ * Pre create insert array function
+ * This allows you to perform certain actions, like run a query
+ * and load data, before create_insert_array() is run. The data
+ * returned from this function will be sent to create_insert_array().
+ *
+ * @param array $post Post data from submit_post
+ * @param array $notify_users Notify users list
+ * Formated from find_users_for_notification()
+ * @return array Whatever you want to send to create_insert_array().
+ */
+ public function pre_create_insert_array($post, $notify_users)
+ {
+ // In the parent class, this is used to check if the post is already
+ // read by a user and marks the notification read if it was marked read.
+ // Returning an empty array in effect, forces it to be marked as unread
+ // (and also saves a query)
+ return array();
+ }
+
+ /**
* Function for preparing the data for insertion in an SQL query
* (The service handles insertion)
*