I have implemented sorting for Subalbums that mimics the sorting for Albums. Of course, no Admin interface yet, but you can set the [b]sort_order[/b] field via SQL or (at least with my ISP) the [b]phpMyAdmin interface.
Replace the [/b][b]getSubAlbums[/b] function in class-album.php with the code below:
`
function getSubAlbums($page=0) {
function sortSubalbumArray($albums)
global $_zp_gallery;
if (is_null($this->subalbums)) {
$dirs = $this->loadFileNames(true);
$subalbums = array();
foreach ($dirs as $dir) {
$dir = $this->name . '/' . $dir;
$subalbums[] = $dir;
}
$sortedSubalbums = $_zp_gallery->sortAlbumArray($subalbums);
$this->subalbums = $sortedSubalbums;
}
if ($page == 0) {
return $this->subalbums;
} else {
$albums_per_page = zp_conf('albums_per_page');
return array_slice($this->subalbums, $albums_per_page*($page-1), $albums_per_page);
}
}
`
Hello,
The sorting is not working for me. It's not the same sorting as the one with the previous function, but it's still not sorted as I want.
I tried to put a value in the sort_order field but it's still not sorted.
What should I do if I want my subalbums sorted by folder name ?
Thanks.