• Resolved dh333

    (@dh333)


    Hi All,

    I recently found a way to change the default sort order when managing a list of galleries on the NextGen’s backend. It involves appending code to line 317 of the ngg-db.php file. (thread reference)

    The solution works great but my concern is that the changes will be overwritten during the next plugin update. In this case, what’s the best way to implement a change of this nature without losing it when an update comes around.

    Thanks in advance for any help

    https://www.ads-software.com/plugins/nextgen-gallery/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @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!

    Benjamin

    (@benjaminowens)

    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)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Update-proof Customizations to NextGen’ is closed to new replies.