mirror of
https://github.com/friendica/friendica
synced 2024-12-22 22:00:16 +00:00
Replace obsolete posted sort field by created in mod\photos
This commit is contained in:
parent
7c1ae71527
commit
ee96c26ede
1 changed files with 7 additions and 7 deletions
|
@ -977,7 +977,7 @@ function photos_content(App $a)
|
||||||
|
|
||||||
/// @TODO I have seen this many times, maybe generalize it script-wide and encapsulate it?
|
/// @TODO I have seen this many times, maybe generalize it script-wide and encapsulate it?
|
||||||
$order_field = $_GET['order'] ?? '';
|
$order_field = $_GET['order'] ?? '';
|
||||||
if ($order_field === 'posted') {
|
if ($order_field === 'created') {
|
||||||
$order = 'ASC';
|
$order = 'ASC';
|
||||||
} else {
|
} else {
|
||||||
$order = 'DESC';
|
$order = 'DESC';
|
||||||
|
@ -1031,10 +1031,10 @@ function photos_content(App $a)
|
||||||
$drop = [DI::l10n()->t('Drop Album'), 'photos/' . $user['nickname'] . '/album/' . bin2hex($album) . '/drop'];
|
$drop = [DI::l10n()->t('Drop Album'), 'photos/' . $user['nickname'] . '/album/' . bin2hex($album) . '/drop'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($order_field === 'posted') {
|
if ($order_field === 'created') {
|
||||||
$order = [DI::l10n()->t('Show Newest First'), 'photos/' . $user['nickname'] . '/album/' . bin2hex($album), 'oldest'];
|
$order = [DI::l10n()->t('Show Newest First'), 'photos/' . $user['nickname'] . '/album/' . bin2hex($album), 'oldest'];
|
||||||
} else {
|
} else {
|
||||||
$order = [DI::l10n()->t('Show Oldest First'), 'photos/' . $user['nickname'] . '/album/' . bin2hex($album) . '?order=posted', 'newest'];
|
$order = [DI::l10n()->t('Show Oldest First'), 'photos/' . $user['nickname'] . '/album/' . bin2hex($album) . '?order=created', 'newest'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$photos = [];
|
$photos = [];
|
||||||
|
@ -1054,7 +1054,7 @@ function photos_content(App $a)
|
||||||
'id' => $rr['id'],
|
'id' => $rr['id'],
|
||||||
'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
|
'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
|
||||||
'link' => 'photos/' . $user['nickname'] . '/image/' . $rr['resource-id']
|
'link' => 'photos/' . $user['nickname'] . '/image/' . $rr['resource-id']
|
||||||
. ($order_field === 'posted' ? '?order=posted' : ''),
|
. ($order_field === 'created' ? '?order=created' : ''),
|
||||||
'title' => DI::l10n()->t('View Photo'),
|
'title' => DI::l10n()->t('View Photo'),
|
||||||
'src' => 'photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
|
'src' => 'photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
|
||||||
'alt' => $imgalt_e,
|
'alt' => $imgalt_e,
|
||||||
|
@ -1122,7 +1122,7 @@ function photos_content(App $a)
|
||||||
if ($cmd === 'view' && !DI::config()->get('system', 'no_count', false)) {
|
if ($cmd === 'view' && !DI::config()->get('system', 'no_count', false)) {
|
||||||
$order_field = $_GET['order'] ?? '';
|
$order_field = $_GET['order'] ?? '';
|
||||||
|
|
||||||
if ($order_field === 'posted') {
|
if ($order_field === 'created') {
|
||||||
$params = ['order' => [$order_field]];
|
$params = ['order' => [$order_field]];
|
||||||
} elseif (!empty($order_field)) {
|
} elseif (!empty($order_field)) {
|
||||||
$params = ['order' => [$order_field => true]];
|
$params = ['order' => [$order_field => true]];
|
||||||
|
@ -1150,10 +1150,10 @@ function photos_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($prv)) {
|
if (!is_null($prv)) {
|
||||||
$prevlink = 'photos/' . $user['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . ($order_field === 'posted' ? '?order=posted' : '');
|
$prevlink = 'photos/' . $user['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] . ($order_field === 'created' ? '?order=created' : '');
|
||||||
}
|
}
|
||||||
if (!is_null($nxt)) {
|
if (!is_null($nxt)) {
|
||||||
$nextlink = 'photos/' . $user['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . ($order_field === 'posted' ? '?order=posted' : '');
|
$nextlink = 'photos/' . $user['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] . ($order_field === 'created' ? '?order=created' : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate('photo_edit_head.tpl');
|
$tpl = Renderer::getMarkupTemplate('photo_edit_head.tpl');
|
||||||
|
|
Loading…
Reference in a new issue