@dh333 – We are adding some additional parameters/functionality for gallery sort order management with the next release of NextGEN Gallery.
As it is, the reference you are making is very old and related to NextGEN Legacy, not current NextGEN Gallery code.
I would suggest, if your modifications are working you keep a backup and review how the plugin works after the next update to see if you need to re-implement them and/or change your approach.
Thanks!
– Cais.
Thread Starter
dh333
(@dh333)
Hi Cais,
Thanks for the response and I look forward to seeing the new sort features in the next release. As far as pure functionality goes, the sorting works exactly as I want it. However, can you suggest any non-legacy (updated) code that achieves the same functionality?
Thanks again!
Hi dh333,
There isn’t presently a way to do this with NextGen 2.1 but I’ve added a filter (‘ngg_manage_albums_items_order’) that will be in the next release. You can edit your current instance with my same change to use it right away in an upgrade-safe way; just edit nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/album.php and add this after line 90:
if (apply_filters('ngg_manage_albums_items_order', 'ASC') == 'DESC')
{
$this->albums = array_reverse($this->albums, TRUE);
$this->galleries = array_reverse($this->galleries, TRUE);
}
If you’d like to change the order of galleries displayed in the frontend you use a custom template and rather than calling foreach($galleries as $gallery) use foreach(array_reverse($galleries, TRUE) as $gallery)