]> git.mxchange.org Git - friendica.git/commitdiff
Show unread notifications in a different order than read notifications
authorMichael Vogel <icarus@dabo.de>
Thu, 23 Apr 2015 06:59:30 +0000 (08:59 +0200)
committerMichael Vogel <icarus@dabo.de>
Thu, 23 Apr 2015 06:59:30 +0000 (08:59 +0200)
mod/ping.php

index c8fb582d1a198660f5b0ee15af69fa58a7ce7055..15e7dfab150be936d5a5021f253721e598cdc18a 100644 (file)
@@ -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;