diff --git a/lib/Notifications.lib.php b/lib/Notifications.lib.php index 5c39a83..7823915 100644 --- a/lib/Notifications.lib.php +++ b/lib/Notifications.lib.php @@ -48,7 +48,7 @@ class Notifications { public static function get(User $user) { global $database, $Strings; if ($user->exists()) { - $notifications = $database->select('notifications', ['notificationid (id)', 'timestamp', 'title', 'content', 'url', 'seen', 'sensitive'], ['uid' => $user->getUID()]); + $notifications = $database->select('notifications', ['notificationid (id)', 'timestamp', 'title', 'content', 'url', 'seen', 'sensitive'], ['uid' => $user->getUID(), 'ORDER' => ['seen', 'timestamp' => 'DESC']]); for ($i = 0; $i < count($notifications); $i++) { $notifications[$i]['id'] = $notifications[$i]['id'] * 1; $notifications[$i]['seen'] = ($notifications[$i]['seen'] == "1" ? true : false);