From c348f27e84f4c461acf1fffdb9bbf85a209d24a0 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 23 Apr 2015 08:59:30 +0200 Subject: [PATCH] Show unread notifications in a different order than read notifications --- mod/ping.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/ping.php b/mod/ping.php index c8fb582d1a..15e7dfab15 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -311,6 +311,7 @@ function ping_get_notifications($uid) { $offset = 0; $seen = false; $seensql = "NOT"; + $order = ""; $quit = false; do { @@ -318,7 +319,7 @@ function ping_get_notifications($uid) { FROM `notify` LEFT JOIN `item` ON `item`.`id` = `notify`.`iid` WHERE `notify`.`uid` = %d AND `notify`.`msg` != '' AND NOT (`notify`.`type` IN (%d, %d)) - AND $seensql `notify`.`seen` ORDER BY `notify`.`date` DESC LIMIT %d, 50", + AND $seensql `notify`.`seen` ORDER BY `notify`.`date` $order LIMIT %d, 50", intval($uid), intval(NOTIFY_INTRO), intval(NOTIFY_MAIL), @@ -328,6 +329,7 @@ function ping_get_notifications($uid) { if (!$r AND !$seen) { $seen = true; $seensql = ""; + $order = "DESC"; $offset = 0; } elseif (!$r) $quit = true;