First i would like to say that i'm happy you created a forum. It's much better than the mailing list.
I would like some help in cusomizing my gallery. I want to have the albums sorted in alphabeticly order. How would i do that ?
Also is there any possibility to limit 5 pictures per album ?
Any help would be appriciated.
Thanks
Posts: 8
I think there is a link somewhere near the top called [sort] which you can lick.. and then choose "Sort Alphabetically" and click on the botton.. I think that should work.. unless it is only available inside albums or something.. I would check, but I can't onnect to the server I have my gallery on.. (strange, it was up just a minute ago..)
Posts: 4
Yeah that's only for sorting the pictures for inside the album by name. I tried to modify that code so it would work for album name but didn't have any success. That's why i'm asking for your help :smile:
Posts: 5
I know this isn't exactly what you wanted, but if you click [MOVE ALBUM] you can specify what position it takes in the listing (ie 1 is at the top etc)
Posts: 4
Yeah i noticed that. And that's what i did. It took me about 1 hour because i had more than 200 albums to sort :smile: Thanks for advice.
Posts: 10
Bringing this thread back from the grave :smile:
I too just went through the manual process of moving albums around.
Has anybody worked on any code to help automate this process?
Posts: 1
I was hoping someone had done this but after searching for HOURS, i figured it'd be easier to do it myself. :grin:
This works for me.
Open Albums.php and at line 279 you should have:
} else if (!strcmp($sort, "caption")) {
// sort album alphabetically by caption
$func = "$objA = (object)$a; $objB = (object)$b; ";
$func .= " $captionA = $objA->getCaption(); ";
$func .= " $captionB = $objB->getCaption(); ";
if (!$order) {
$func .= "return (strcmp($captionA, $captionB)); ";
} else {
$func .= "return (strcmp($captionB, $captionA)); ";
}
Replace it with:
} else if (!strcmp($sort, "caption")) {
// sort album alphabetically by caption
$func = "$objA = (object)$a; $objB = (object)$b; ";
$func .= "if ($objA->isAlbumName) { ";
$func .= " $captionA = $objA->isAlbumName; ";
$func .= "} else { ";
$func .= " $captionA = $objA->getCaption(); ";
$func .= "} ";
$func .= "if ($objB->isAlbumName) { ";
$func .= " $captionB = $objB->isAlbumName; ";
$func .= "} else { ";
$func .= " $captionB = $objB->getCaption(); ";
$func .= "} ";
if (!$order) {
$func .= "return (strcasecmp($captionA, $captionB)); ";
} else {
$func .= "return (strcasecmp($captionB, $captionA)); ";
}
It now looks at the albums name and the pictures caption. The compare is now case insensitive too.
!!!Important!!! This forum strips off 's. Before most $ there should be a ...look at your current code and replace as needed.
Posts: 75
Coo... tried the code but... just curious do you need to hit the sort button to activate this?
Posts: 75
Does this only work if your importing the filez, have tried this fix but it doesn't seem to work.
Just curious also about the program itself(is there a way to disable the order that images and folders are displayed and have them ordered by alphabetical(folders above images?)
Posts: 2
Try the "Sort by filename" option in the sort album window. Just remember to "rename" your albums first.
Posts: 75
ah... figured it was something like that...
So it's not possible to change some of the original script so it ignores which folder should be first and do everything alphabetically?