![]() |
|
Manual sorting? - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Manual sorting? (/thread-10.html) |
Manual sorting? - wes - 2005-09-19 I've gotta preface this by saying: thanks, Tristan, for this fantastic program! Even in beta, I like it MUCH better than everything else I've tried. On to the question: Per the ZenPhoto web page, I already know that sorting is planned for a future release. Until then, is there a way to manually "force" the sorting of albums on the index page? Such as modifying the album creation date, or something? Manual sorting? - trisweb - 2005-09-19 Sort of... the way PHP returns the array of files is based on creation time. So upload in the reverse order you want them (first uploaded files will be last). There's not really a way to modify this after you've uploaded, so it's not really good for sorting. I'll try to get that in the next version... Manual sorting? - kaline - 2005-09-28
Manual sorting? - cdkrall - 2005-09-28 Me too. One idea: Could ZP respect the order the files are numbered in, as in 1.jpg, 2.jpg...etc, or 2003.jpg, 2345, jpg. If that could be done, one could rearrange them via ftp renaming. For now... This would make it possible to have a photo that stays at the bottom, 9999999.jpg for example, and one that stays at the top of a gallery. Manual sorting? - trisweb - 2005-09-28 Some great sorting interface will be available for 1.0, just not yet ;-) I know, it's really bugging me too, and that just means it'll be done faster. Manual sorting? - loudestnoise - 2005-10-07 sorting would be amaaazing. doesn't even have to be AJAX, just anything. Manual sorting? - jabo - 2005-11-21 php has a number of bult in functions for sorting arrays. so for instance if you wanted to sort your images alphabetically you could add a line like sort($images); to the get_image function Manual sorting? - Luckyspin - 2005-11-27 Yeah, natcasesort is probably a better bet. Stick this in at line 311 of classes.php: natcasesort($images); This'll give you basic natural alphabetical sorting, which works pretty well for most image names. Especially if you have just pulled them off a digital camera. Manual sorting? - andrea - 2005-12-01 adding natcasesort($images); worked great for sorting the images, but it did something weird where some pictures would be skipped when i would go through an album from one picture to another, so i had to take it back out for now. any idea why that happened? Manual sorting? - Luckyspin - 2005-12-01 Yeah, I noticed that too. The natcasesort fix works for the Albums view, but the next/prev links don't work correctly. I'll look into it. Manual sorting? - trisweb - 2005-12-02 It may be the indexing in the array... it's pretty hacky how it's done, but essentially, the entire album is an array which is loaded each time, and the next/prev just use the index of the current in that array. So make sure it's always sorted the same way I guess. Manual sorting? - Luckyspin - 2005-12-07 Yeah, that was it. Since we're using the numerical index of the array to get the next/prev images, we need to store the new array values, without the previous keys. So, after the while loop in getImages, insert this: natcasesort($images);
Note: the last line replaces the previous storing of the array. That'll solve the next/prev links problem. Manual sorting? - andrea - 2005-12-07 excellent! works perfectly. thanks. Manual sorting? - mattscape - 2005-12-19 well it doesn't work for me. natcasesort($images); but the albums on the index pages are still in an order i can't recall Manual sorting? - Luckyspin - 2005-12-20 This fix was only to sort the images in an album, NOT the albums in the main index page of the Gallery. Manual sorting? - mattscape - 2005-12-20 well how does zenphoto sort the index page? Manual sorting? - Luckyspin - 2005-12-22 Check out my post in the Status topic for some good news on manual sorting! http://www.zenphoto.org/support/topic.php?id=138 |