When I use printLatestImagesByMtime a lot of images are missing.
I have 1 album, sorted by Mtime.
doesn't look the same as the first page of my album, a lot of images are missing. When I uploaded 9 photo's only 4 appeared in the printLatestImagesByMtime function.
When I sort my album by ID and use printLatestImages I also don't get the same output. A few images have swapped places.
I use 1.4.0.4.
I tried it without quotes, but same result.
No unpublished or protected images.
I tried the nightly, problem still there.
I have the printLatestImagesByMtime on the index and only 1 album with 270 photo's, the album is sorted by Mtime configured in the gallery options.
The first 27 images from printLatestImagesByMtime are not the same as the album, a lot of them are missing.
When I use printLatestImages instead, and sort the album by ID, then sometimes the order is not the same, a few images have swapped places if you compare printLatestImages with the album.
Pretty weird huh?
I checked what you changed and did it myself and tested it.
All images are now appearing in the function, but the order is not the same as the album.
Album
1 2 3 4 5 6 7 8 9
printLatestImagesByMtime
2 1 3 9 4 5 7 6 8
I also noticed this with printLatestImages function and sorting the album on ID.
I tried it with a fresh install:
1 - created one album with mtime decending in options->image
2 - uploaded 100 images
3 - edited the default theme with printLatestImagesByMtime(27) on the index
4 - everything looked oké, all 27 images have the same order, both in printLatestImagesByMtime as the album
5 - uploaded 9 new images
6 - the order between the first 9 images of printLatestImagesByMtime was not the same as the album
7 - uploaded 9 new images
8 - first 9 images have the same order, but images 10-18 have different order, but it's also different then the order i had in (6).
9 - uploaded 9 new images
10 - all 27 have the same order
11 - uploaded 9 new images
12 - 2 of the newly uploaded images have "switched places".
It looks so random, that i'm afraid i'm doing something incredibly stupid
I also posted it in the bugtracker.
Have you checked the actual "mtime" of the files? mtime represents the time last "changed" of the file, so may not be a solid indicator of when the file is first uploaded.
On Unix systems there is no reliabale timestamp to know when a file was created. Probably the best bet is the Zenphoto ID of the image. That at least represents when Zenphoto discovered the image.
I tested it local on a windows7 system.
I experienced printLatestImages and sorting by ID had the same problems, but I can't replicate it now, so sorting by ID seems to be the quick fix for me.
But it stays weird that printLatestImagesByMtime and a album sorted by mtime have a different sorting order. Especially because of the randomness I described.