Sorting albums alphabetically [new] Sorting albums alphabetically [new]
 

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

Main Menu

Sorting albums alphabetically [new]

Started by ixar, December 24, 2010, 07:42:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ixar

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" .


        $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;



    $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 .

ΑndrĂ©

Open your category 'CC (cat 1)' and check if it works there.