Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Sorting albums alphabetically [new]  (Read 1642 times)

0 Members and 1 Guest are viewing this topic.

ixar

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 1
Sorting albums alphabetically [new]
« on: December 24, 2010, 07:42:48 am »

Hi .

I'm trying to sort the albums displayed on the main page , alphabetically . [and failing]

The solution provided here didn't work .
I have replaced 2 occurrences or "ORDER BY a.pos" with "ORDER BY a.title" .

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.title, a.aid ' . $limit;

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.title, a.aid $limit";

Any other ideas ?
Can't link to website , it's currently on localhost .
Attaching screenshot .
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15757
Re: Sorting albums alphabetically [new]
« Reply #1 on: December 30, 2010, 11:13:04 am »

Open your category 'CC (cat 1)' and check if it works there.
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.