Advanced search  

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

Pages: [1]   Go Down

Author Topic: Sort albums alphabettically  (Read 2986 times)

0 Members and 1 Guest are viewing this topic.

dEnA

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Sort albums alphabettically
« on: February 07, 2006, 05:33:16 pm »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Sort albums alphabettically
« Reply #1 on: February 07, 2006, 06:18:03 pm »

in index.php find the function list_users

replace the var $sql with

Code: [Select]
       $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
« Last Edit: February 07, 2006, 06:34:46 pm by Stramm »
Logged

Nibbler

  • Guest
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.