X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FNotificationsManager.php;h=8ac5d93c729d33779573990638b978af602dcf3e;hb=c34204cf50ced68a14d220706c4dc6ef93eb94c9;hp=bc1d1a00aa656993743b993dc9beb002ecbfea48;hpb=c93f527beb9756e8fb6fe97223c4e65d51fe52b6;p=friendica.git diff --git a/src/Core/NotificationsManager.php b/src/Core/NotificationsManager.php index bc1d1a00aa..8ac5d93c72 100644 --- a/src/Core/NotificationsManager.php +++ b/src/Core/NotificationsManager.php @@ -394,7 +394,7 @@ class NotificationsManager extends BaseObject $fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar', 'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid']; - $params = ['order' => ['created' => true], 'limit' => [$start, $limit]]; + $params = ['order' => ['received' => true], 'limit' => [$start, $limit]]; $items = Item::selectForUser(local_user(), $fields, $condition, $params); @@ -485,7 +485,7 @@ class NotificationsManager extends BaseObject $fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar', 'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid']; - $params = ['order' => ['created' => true], 'limit' => [$start, $limit]]; + $params = ['order' => ['received' => true], 'limit' => [$start, $limit]]; $items = Item::selectForUser(local_user(), $fields, $condition, $params); @@ -527,7 +527,7 @@ class NotificationsManager extends BaseObject $fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar', 'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid']; - $params = ['order' => ['created' => true], 'limit' => [$start, $limit]]; + $params = ['order' => ['received' => true], 'limit' => [$start, $limit]]; $items = Item::selectForUser(local_user(), $fields, $condition, $params); if (DBA::isResult($items)) { @@ -563,7 +563,7 @@ class NotificationsManager extends BaseObject $sql_extra = ""; if (!$all) { - $sql_extra = " AND `ignore` = 0 "; + $sql_extra = " AND NOT `ignore` "; } /// @todo Fetch contact details by "Contact::getDetailsByUrl" instead of queries to contact, fcontact and gcontact @@ -578,11 +578,11 @@ class NotificationsManager extends BaseObject LEFT JOIN `contact` ON `contact`.`id` = `intro`.`contact-id` LEFT JOIN `gcontact` ON `gcontact`.`nurl` = `contact`.`nurl` LEFT JOIN `fcontact` ON `intro`.`fid` = `fcontact`.`id` - WHERE `intro`.`uid` = %d $sql_extra AND `intro`.`blocked` = 0 - LIMIT %d, %d", - intval($_SESSION['uid']), - intval($start), - intval($limit) + WHERE `intro`.`uid` = ? $sql_extra AND `intro`.`blocked` = 0 + LIMIT ?, ?", + $_SESSION['uid'], + $start, + $limit ); if (DBA::isResult($stmtNotifies)) { $notifs = $this->formatIntros(DBA::toArray($stmtNotifies));