diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-09-09 09:10:11 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-09-09 09:10:11 -0500 |
commit | 2fb9f2ce6ad44e6dcacc6914379b09d795daace2 (patch) | |
tree | c58d683bdb0d9255f6960ef21f197d2630ec4c84 /phpBB/includes/notifications/service.php | |
parent | b58ef116e1157311463ae9c5c313b314764eb9e2 (diff) | |
parent | 98a03090a05b1d7651c05ad23802973cf20dcf6b (diff) | |
download | forums-2fb9f2ce6ad44e6dcacc6914379b09d795daace2.tar forums-2fb9f2ce6ad44e6dcacc6914379b09d795daace2.tar.gz forums-2fb9f2ce6ad44e6dcacc6914379b09d795daace2.tar.bz2 forums-2fb9f2ce6ad44e6dcacc6914379b09d795daace2.tar.xz forums-2fb9f2ce6ad44e6dcacc6914379b09d795daace2.zip |
Merge branch 'ticket/11103' of github.com:EXreaction/phpbb3 into ticket/11103
Diffstat (limited to 'phpBB/includes/notifications/service.php')
-rw-r--r-- | phpBB/includes/notifications/service.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/phpBB/includes/notifications/service.php b/phpBB/includes/notifications/service.php index 74e2e29e1a..4794472883 100644 --- a/phpBB/includes/notifications/service.php +++ b/phpBB/includes/notifications/service.php @@ -46,6 +46,8 @@ class phpbb_notifications_service * * @param array $options Optional options to control what notifications are loaded * user_id User id to load notifications for (Default: $user->data['user_id']) + * order_by Order by (Default: time) + * order_dir Order direction (Default: DESC) * limit Number of notifications to load (Default: 5) * start Notifications offset (Default: 0) */ @@ -58,12 +60,15 @@ class phpbb_notifications_service 'user_id' => $user->data['user_id'], 'limit' => 5, 'start' => 0, + 'order_by' => 'time', + 'order_dir' => 'DESC', ), $options); $notifications = $user_ids = array(); $sql = 'SELECT * FROM ' . NOTIFICATIONS_TABLE . ' - WHERE user_id = ' . (int) $options['user_id']; + WHERE user_id = ' . (int) $options['user_id'] . ' + ORDER BY ' . $this->db->sql_escape($options['order_by']) . ' ' . $this->db->sql_escape($options['order_dir']); $result = $this->db->sql_query_limit($sql, $options['limit'], $options['start']); while ($row = $this->db->sql_fetchrow($result)) |