mirror of
https://github.com/friendica/friendica
synced 2024-11-18 15:43:42 +00:00
Update src/Module/Api/Friendica/Photoalbum/Show.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
parent
ae8f1a1c5b
commit
6af4bfae21
1 changed files with 10 additions and 12 deletions
|
@ -90,20 +90,18 @@ class Show extends BaseApi
|
||||||
$photos = Photo::selectToArray(['resource-id'], $condition, $params);
|
$photos = Photo::selectToArray(['resource-id'], $condition, $params);
|
||||||
|
|
||||||
$data = ['photo' => []];
|
$data = ['photo' => []];
|
||||||
if (DBA::isResult($photos)) {
|
foreach ($photos as $photo) {
|
||||||
foreach ($photos as $photo) {
|
$element = $this->friendicaPhoto->createFromId($photo['resource-id'], null, $uid, 'json', false);
|
||||||
$element = $this->friendicaPhoto->createFromId($photo['resource-id'], null, $uid, 'json', false);
|
|
||||||
|
|
||||||
$element['thumb'] = end($element['link']);
|
$element['thumb'] = end($element['link']);
|
||||||
unset($element['link']);
|
unset($element['link']);
|
||||||
|
|
||||||
if ($type == 'xml') {
|
if ($type == 'xml') {
|
||||||
$thumb = $element['thumb'];
|
$thumb = $element['thumb'];
|
||||||
unset($element['thumb']);
|
unset($element['thumb']);
|
||||||
$data['photo'][] = ['@attributes' => $element, '1' => $thumb];
|
$data['photo'][] = ['@attributes' => $element, '1' => $thumb];
|
||||||
} else {
|
} else {
|
||||||
$data['photo'][] = $element;
|
$data['photo'][] = $element;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue