coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: Criss on June 21, 2010, 01:04:25 PM

Title: Sorting albums alphabetically
Post by: Criss 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 (http://forum.coppermine-gallery.net/index.php/topic,29809.msg137973.html#msg137973) doesn't work anymore.

http://joejonasphotos.org

Title: Re: Sorting albums alphabetically
Post by: Joachim Müller on June 21, 2010, 01:32:53 PM
The instructions in the other thread say you need to replace ORDER BY a.poswith 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        $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    $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";
Title: Re: Sorting albums alphabetically
Post by: Criss on June 21, 2010, 10:19:48 PM
Got it! Thanks!  ;)