X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fphotos.php;h=18db9c15d997e8433ddd6d62552cdb56cc73e5ae;hb=fd5914011cb5c67b827886a5db0e7760a307ad1d;hp=a1aebfac6686f1ee59d1edd002c8c5319b883404;hpb=4faf08c0643d3e6bbe2a0a77be2ff8c1dbea4d5c;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index a1aebfac66..18db9c15d9 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -62,7 +62,7 @@ function photos_init(App $a) Nav::setSelected('home'); if (DI::args()->getArgc() > 1) { - $owner = User::getOwnerDataByNick(DI::args()->getArgv()[1]); + $owner = Profile::load(DI::app(), DI::args()->getArgv()[1], false); if (!isset($owner['account_removed']) || $owner['account_removed']) { throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); } @@ -111,12 +111,6 @@ function photos_init(App $a) ]); } - if (empty(DI::page()['aside'])) { - DI::page()['aside'] = ''; - } - - DI::page()['aside'] .= Widget\VCard::getHTML($owner); - if (!empty($photo_albums_widget)) { DI::page()['aside'] .= $photo_albums_widget; } @@ -937,11 +931,17 @@ function photos_content(App $a) $nxt = null; foreach ($prvnxt as $z => $entry) { if ($entry['resource-id'] == $ph[0]['resource-id']) { - $prv = $z - 1; - $nxt = $z + 1; + $prv = $order_field === 'created' ? $z - 1 : $z + 1; + $nxt = $order_field === 'created' ? $z + 1 : $z - 1; if ($prv < 0) { $prv = count($prvnxt) - 1; } + if ($nxt < 0) { + $nxt = count($prvnxt) - 1; + } + if ($prv >= count($prvnxt)) { + $prv = 0; + } if ($nxt >= count($prvnxt)) { $nxt = 0; } @@ -1139,7 +1139,7 @@ function photos_content(App $a) '$preview' => DI::l10n()->t('Preview'), '$loading' => DI::l10n()->t('Loading...'), '$qcomment' => $qcomment, - '$rand_num' => Crypto::randomDigits(12) + '$rand_num' => Crypto::randomDigits(12), ]); } } @@ -1194,7 +1194,7 @@ function photos_content(App $a) '$submit' => DI::l10n()->t('Submit'), '$preview' => DI::l10n()->t('Preview'), '$qcomment' => $qcomment, - '$rand_num' => Crypto::randomDigits(12) + '$rand_num' => Crypto::randomDigits(12), ]); } @@ -1268,7 +1268,7 @@ function photos_content(App $a) '$submit' => DI::l10n()->t('Submit'), '$preview' => DI::l10n()->t('Preview'), '$qcomment' => $qcomment, - '$rand_num' => Crypto::randomDigits(12) + '$rand_num' => Crypto::randomDigits(12), ]); } }