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.
Not a member yet? Click here to register.
Forgot Password?

how do I change the photo sorting in a album

Asked Modified Viewed 1,179 times
T
tjakob
T
tjakob 10
  • Newbie, joined since
  • Contributed 9 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
asked
Newbie

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,
0 replies

2 posts

D
douwe_yntema
D
  • Senior Member, joined since
  • Contributed 667 posts on the community forums.
  • Started 57 threads in the forums
  • Answered 1 question
answered
Senior Member

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']]);
0 replies
T
tjakob
T
tjakob 10
  • Newbie, joined since
  • Contributed 9 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Newbie

THANK YOU!
Happy New Year 2022!
0 replies

Labels

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

T
T
tjakob 10
  • Newbie, joined since
  • Contributed 9 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
D
D
  • Senior Member, joined since
  • Contributed 667 posts on the community forums.
  • Started 57 threads in the forums
  • Answered 1 question

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet