forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: smarko on February 29, 2004, 02:28:08 am

Title: How to sort users?
Post by: smarko on February 29, 2004, 02:28:08 am
How can I sort users? It should affect page in address like "..index.php?cat=1". I traced the place to change something to bridge-files (in my case it's invisionboard.inc.php).

But changing "ORDER BY category" to "ORDER BY title" doesn't work. Error "There was an error while processing a database query" will result. What should I change?


Code: [Select]
// Query used to list users
function udb_list_users_query(&$user_count)
{
    global $CONFIG, $FORBIDDEN_SET;

    $sql = "SELECT (category - " . FIRST_USER_CAT . ") as user_id," . "                '???' 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 " . "WHERE approved = 'YES' AND category > " . FIRST_USER_CAT . " " . "$FORBIDDEN_SET " . "GROUP BY category " . "ORDER BY category ";
    $result = db_query($sql);

    $user_count = mysql_num_rows($result);

    return $result;
}
Title: How to sort users?
Post by: Widi on February 29, 2004, 03:41:12 am
You're changing in the wrong lines.

See topic:

http://forum.coppermine-gallery.net/index.php?topic=1379
Title: How to sort users?
Post by: smarko on February 29, 2004, 04:54:30 am
I put my words wrong. Subject and my question corrected. So, question actually is.. How can I sort users? It should affect page in address like "..index.php?cat=1". The function above is the one that should be changed, because it's the one that is called when listing users. See below..


Code: [Select]
function list_users()
{
    global $CONFIG, $PAGE, $FORBIDDEN_SET;
    global $lang_list_users, $lang_errors, $template_user_list_info_box;

    if (defined('UDB_INTEGRATION')) {
        $result = udb_list_users_query($user_count);
...