<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
$arr['guid'] = System::createUUID();
$arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri;
- $arr['type'] = 'photo';
+ $arr['post-type'] = Item::PT_IMAGE;
$arr['wall'] = 1;
$arr['resource-id'] = $resource_id;
$arr['contact-id'] = $owner_record['id'];
// 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 `post-view` WHERE `resource-id` = '%s' $sql_extra LIMIT 1",
+ $linked_items = q("SELECT `id` FROM `post-user-view` WHERE `resource-id` = '%s' $sql_extra LIMIT 1",
DBA::escape($datum)
);
if (DBA::isResult($linked_items)) {