coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: antisa33 on June 09, 2005, 03:58:48 PM

Title: A lot of albums automatically alphabet sort
Post by: antisa33 on June 09, 2005, 03:58:48 PM
Hello
I enjoy a lot the coppermine gallery thank you!!
I have a lot of albums (171) and they are not sorted.
I have tried to sort them by hand by it's very long to do that and it's not automatic.
Where can i modify a file to sort alphabetically all the albums on the main page (index)?
Thank you!!
Isa
Title: Re: A lot of albums automatically alphabet sort
Post by: havoc615 on June 10, 2005, 03:44:28 AM
I think you'd replace:
$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;

In index.php with:
$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.title '.

          $limit;


You probably have to do it twice, in addition, by the way the codes written, it looks like albums with categories might be after albums without. So they'd sort individually? Im sure you motly have all one way or the other though. Lemmie know how it goes.
Title: Re: A lot of albums automatically alphabet sort
Post by: antisa33 on June 10, 2005, 08:42:45 AM
Thank you havoc615 It's exactly that !!
Thanks !!  :)