How to sort users? How to sort users?
 

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

How to sort users?

Started by smarko, February 29, 2004, 02:28:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

smarko

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?


// 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;
}

Widi


smarko

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..


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);
...