- $items_stmt = DBA::p(
- "SELECT `parent-uri-id` AS `uri-id`, MAX(`created`), MAX(`received`) FROM `post-user-view`
- WHERE `uid` = ? AND NOT `contact-blocked` AND NOT `contact-pending`
- AND `visible` AND (NOT `deleted` OR `gravity` = ?)
- AND `wall` $sql_extra4 $sql_extra
- GROUP BY `parent-uri-id` ORDER BY `received` DESC",
- $a->getProfileOwner(),
- GRAVITY_ACTIVITY
- );
-
- if (!DBA::isResult($items_stmt)) {
+ $items = Post::selectToArray(['parent-uri-id', 'created', 'received'], $condition, ['group_by' => ['parent-uri-id'], 'order' => ['received' => true]]);
+ if (!DBA::isResult($items)) {