A lot of albums automatically alphabet sort A lot of albums automatically alphabet sort
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

A lot of albums automatically alphabet sort

Started by antisa33, June 09, 2005, 03:58:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

antisa33

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

havoc615

#1
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.

antisa33

Thank you havoc615 It's exactly that !!
Thanks !!  :)