![]() |
|
Set custom sort order from GET - 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: Set custom sort order from GET (/thread-10111.html) |
Set custom sort order from GET - amucklow - 2012-06-27 Hello Is it possible to do something like this (using a custom GET() function)?
Set custom sort order from GET - acrylian - 2012-06-27 Albums may have their own sortorder set which overrides the global one. So you need to set the album one directly. Some options cannot be set temparily and need to be really saved to work (last parameter to true). I am not sure right now if this is one of these. If the option is of course useless if you want users to change that. Btw, you don't need a custom get funtion, the variable $_GET['sort'] is available if you append something to the url like &sort=. (That's php basics btw). Set custom sort order from GET - sbillard - 2012-06-27 Sort order can also be overridden in the various function calls, for instance Set custom sort order from GET - amucklow - 2012-06-28 Thanks - so just for others' benefit what I have now is: ` while (next_album(true, $sort)): endwhile; Set custom sort order from GET - sbillard - 2012-06-28 Just a small warning on this. If the sort passed is somehow not valid it may cause an error. Hackers often pass garbage strings to try to sus out a security hole. Something to think about. Set custom sort order from GET - amucklow - 2012-07-03 OK - but I guess I could do a custom getSort() function that checked the sort against a list of pre-defined strings, 'name', 'id', 'date' etc. Set custom sort order from GET - sbillard - 2012-07-03 Sounds like a good idea. |