Member
Member
aitf311   2007-08-10, 02:55
#1

My subalbums are appearing in the order that I upload them, oldest on top, newest on bottom.

I would like to have it be the opposite, with the oldest on the bottom, newest on top. Does anyone know how to accomplish this?

Member
Member
aitf311   2007-08-10, 04:06
#2

I retract my question! While applying some ticket patches to my code, one of them did the trick for me. Thanks to whoever read this anyways.

Member
Member
sbillard   2007-08-10, 19:12
#3

Subalbums don't get sorted in the current ZenPhoto versions. If you want to set the order of appearances you can, but it is a 'manual' process and you need to modify class-album.php around line 130. Change the code which reads:
` // Sort here?

  $this->subalbums = $subalbums;`

to
` if (is_null($_zp_gallery)) {

    $sortedSubalbums = $subalbums;

  } else {

    $sortedSubalbums = $_zp_gallery->sortAlbumArray($subalbums); 

  }

  $this->subalbums = $sortedSubalbums;`

You have to use SQL queries to change the sort_order field in the database for each of the subalbums. I use phpMyAdmin for this.

Member
Member
aitf311   2007-08-10, 19:20
#4

sbillard, will this fall back on the old way if the subalbums are not sorted?

Member
Member
sbillard   2007-08-10, 23:24
#5

Here is what the comment says:

` * Sort the album array based on either a) the manual sort order as specified by the user,

  • or b) the reverse order of how they are returned from disk. This will thus give us the

  • album list in with the the ordered albums first, followed by the rest with the newest first.`

Before, there was no sorting, so the albums came back in the order returned from disk.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.