Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
Forgot Password?
Navigation

how do I change the photo sorting in a album

Last updated on 4 years ago
T
tjakobNewbie
Posted 4 years ago
Hello All,
how do I change the photo sorting in an album. I want the gallery to start with the newest photo. Sorting now starts with the oldest.
Regards and Happy New Year 2022!
Edited by Falk on 08-01-2022 11:18, 4 years ago
D
douwe_yntemaSenior Member
Posted 4 years ago
Goto file
yoursite/infusions/gallery/gallery.php.

Search for line 265:
 GROUP BY photo_id ORDER BY photo_order


change to:
 GROUP BY photo_id ORDER BY photo_order DESC


This is for the listing of the album.

For browsing, search for line 51:
 WHERE ".groupaccess('album_access')." AND photo_id='".intval($_GET['photo_id'])."' GROUP BY p.photo_id");


change to:
WHERE ".groupaccess('album_access')." AND photo_id='".intval($_GET['photo_id'])."' GROUP BY p.photo_id ORDER BY photo_order DESC");


And search for line 57/58:
$pres = dbquery("SELECT photo_id FROM ".DB_PHOTOS." WHERE photo_order=:porder AND album_id=:albumid", [':porder' => ($data['photo_order'] - 1), ':albumid' => $data['album_id']]);
 $nres = dbquery("SELECT photo_id FROM ".DB_PHOTOS." WHERE photo_order=:porder AND album_id=:albumid", [':porder' => ($data['photo_order'] + 1), ':albumid' => $data['album_id']]);


Change to:
$pres = dbquery("SELECT photo_id FROM ".DB_PHOTOS." WHERE photo_order=:porder AND album_id=:albumid", [':porder' => ($data['photo_order'] + 1), ':albumid' => $data['album_id']]);
 $nres = dbquery("SELECT photo_id FROM ".DB_PHOTOS." WHERE photo_order=:porder AND album_id=:albumid", [':porder' => ($data['photo_order'] - 1), ':albumid' => $data['album_id']]);
T
tjakobNewbie
Posted 4 years ago
THANK YOU!
Happy New Year 2022!
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
Moderator: Support Team
Users who participated in discussion: tjakob, douwe_yntema