Sort albums alphabettically Sort albums alphabettically
 

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]

Main Menu

Sort albums alphabettically

Started by dEnA, February 07, 2006, 05:33:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dEnA

Hi, I have tried search and didnt find the solution for my easy problem.

http://motorfreaks.org/gallery/index.php?cat=1&page=1

I want theese albums to be automatically sort by users name alphabetically
Not by when theyre mabe like it's now
Thanks in advance

Stramm

#1
in index.php find the function list_users

replace the var $sql with

       $sql = "SELECT owner_id as user_id, " .
               "owner_name as user_name, " .
               "COUNT(DISTINCT a.aid) as alb_count, " .
               "COUNT(DISTINCT pid) as pic_count, " .
               "MAX(pid) as thumb_pid " .
               "FROM {$CONFIG['TABLE_ALBUMS']} AS a  " .
               "INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON (p.aid = a.aid AND approved = 'YES') ";
        if ($FORBIDDEN_SET != "") $sql .= "WHERE $FORBIDDEN_SET ";
        $sql .= "AND category >= " . FIRST_USER_CAT . " GROUP BY user_id " .
                //"ORDER BY thumb_pid DESC"; // order by last uploaded
                "ORDER BY user_name ASC"; // order by user name


edit: sorry, thought I'm in the 1.3 support board... therefore this is only valid for 1.3x