X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fphotos.php;h=71e32d4de4046cffb539328aee7e7aae8a132cc3;hb=215c6ecc14b799dc5359fd933275d9307ccd35ed;hp=817e9fc53fbfc203ece9a3709478cd0cef7020a9;hpb=8b9205a9a52805afaccbcb7e70a91786dc7e24ff;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index 817e9fc53f..71e32d4de4 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1266,7 +1266,7 @@ function photos_content(App $a) // as a "post" but displaying instead the photo it is linked to /// @todo Rewrite this query. To do so, $sql_extra must be changed - $linked_items = q("SELECT `id` FROM `item` WHERE `resource-id` = '%s' $sql_extra LIMIT 1", + $linked_items = q("SELECT `id` FROM `post-view` WHERE `resource-id` = '%s' $sql_extra LIMIT 1", DBA::escape($datum) ); if (DBA::isResult($linked_items)) { @@ -1276,13 +1276,12 @@ function photos_content(App $a) if (!empty($link_item['parent']) && !empty($link_item['uid'])) { $condition = ["`parent` = ? AND `gravity` != ?", $link_item['parent'], GRAVITY_PARENT]; - $total = DBA::count('item', $condition); + $total = Post::count($condition); $pager = new Pager(DI::l10n(), DI::args()->getQueryString()); $params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]]; - $result = Item::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params); - $items = Item::inArray($result); + $items = Post::toArray(Post::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params)); if (local_user() == $link_item['uid']) { Item::update(['unseen' => false], ['parent' => $link_item['parent']]);