Sort albums alphabettically Sort albums alphabettically
 

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

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