coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: zieloo on October 06, 2007, 03:00:01 PM

Title: sort albums by date
Post by: zieloo on October 06, 2007, 03:00:01 PM
Hi

How do I sort albums inside a category by date (asc or desc, whatever) ?

Thanks
Title: Re: sort albums by date
Post by: just_some_guy on October 06, 2007, 03:02:06 PM
use the "DATE + -" buttons on the top right.
Title: Re: sort albums by date
Post by: zieloo on October 06, 2007, 03:05:30 PM
Quote from: just_some_guy on October 06, 2007, 03:02:06 PM
use the "DATE + -" buttons on the top right.

I want to sort the albums NOT the pictures within them...
Title: Re: sort albums by date
Post by: zieloo on October 11, 2007, 05:18:25 PM
Anyone?
Title: Re: sort albums by date
Post by: Nibbler on October 11, 2007, 07:37:45 PM
You can make a small mod to index.php to adjust the sort order. Search the board - the answer is already posted.
Title: Re: sort albums by date
Post by: zieloo on October 11, 2007, 09:05:27 PM
Done. :D
Change:
'    $sql = 'SELECT a.aid, a.title, a.description, visibility, filepath, ' . 'filename, url_prefix, pwidth, pheight ' . 'FROM ' . $CONFIG['TABLE_ALBUMS'] . ' as a ' . 'LEFT JOIN ' . $CONFIG['TABLE_PICTURES'] . ' as p ' . 'ON a.thumb=p.pid ' . 'WHERE category=' . $cat . $album_filter . ' ORDER BY a.pos' . $limit;'

to:
'    $sql = 'SELECT a.aid, a.title, a.description, visibility, filepath, ' . 'filename, url_prefix, pwidth, pheight ' . 'FROM ' . $CONFIG['TABLE_ALBUMS'] . ' as a ' . 'LEFT JOIN ' . $CONFIG['TABLE_PICTURES'] . ' as p ' . 'ON a.thumb=p.pid ' . 'WHERE category=' . $cat . $album_filter . ' ORDER BY a.pos DESC ' . $limit;'

line: aprox 605, file: index.php

Thanks, Nibbler :)