•  » Your Piwigo
  •  » Order albums on index.php page by category number/id descending

#1 2011-12-11 15:25:50

mathias
Member
2011-12-11
10

Order albums on index.php page by category number/id descending

I wanted to order the albums on the index homepage based on the category id descending so the latest albums I uploaded with piwigo export are displayed first.

This order is convenient if you display on an IPAD and do not want to scroll down to the latest album.
I did not want to sort manually on the admin page.

To accomplish this requirement, I had to do the following code change in include/category_cats.inc.php

replace:

if ('recent_cats' != $page['section'])
{
  $query.= '
  ORDER BY rank';
}

with

if ('recent_cats' != $page['section'])
{
  $query.= '
  ORDER BY c.id desc';
}

Maybe you want to add an option on the admin page to automatically display the albums based on the id descending.

Thanks,

Mathias

Last edited by mathias (2011-12-11 15:26:54)

Offline

 
  •  » Your Piwigo
  •  » Order albums on index.php page by category number/id descending

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2025 · Contact