Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Sorting albums alphabetically  (Read 5938 times)

0 Members and 1 Guest are viewing this topic.

Criss

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Sorting albums alphabetically
« on: June 21, 2010, 01:04:25 pm »

Hi,

Can anyone tell me how can I sort albums alphabetically under category? Modification for version 1.4 doesn't work anymore.

http://joejonasphotos.org

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Sorting albums alphabetically
« Reply #1 on: June 21, 2010, 01:32:53 pm »

The instructions in the other thread say you need to replace
Code: [Select]
ORDER BY a.poswith
Code: [Select]
ORDER BY a.titlein index.php in the relevant queries. Did you try that? It's in the code two times - the corresponding queries are
Code: [Select]
        $sql = 'SELECT a.aid, a.title, a.description, a.thumb, a.keyword, category, visibility, filepath, filename, url_prefix, pwidth, pheight, a.owner '
            . ' FROM ' . $CONFIG['TABLE_ALBUMS'] . ' as a '
            . ' LEFT JOIN ' . $CONFIG['TABLE_PICTURES'] . ' as p ' . 'ON a.thumb=p.pid '
            . ' WHERE a.category=' . $cat . $album_filter
            . ' ORDER BY a.pos, a.aid ' . $limit;
and
Code: [Select]
    $sql = "SELECT a.aid, count( p.pid ) AS pic_count, max( p.pid ) AS last_pid, max( p.ctime ) AS last_upload, a.keyword, a.alb_hits"
            ." FROM {$CONFIG['TABLE_ALBUMS']} AS a "
            ." LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON a.aid = p.aid AND p.approved = 'YES' "
            ." WHERE a.category = $cat $album_filter GROUP BY a.aid ORDER BY a.pos, a.aid $limit";
Logged

Criss

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: Sorting albums alphabetically
« Reply #2 on: June 21, 2010, 10:19:48 pm »

Got it! Thanks!  ;)
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 20 queries.