Advanced search  

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]

Pages: [1]   Go Down

Author Topic: How to sort users?  (Read 2789 times)

0 Members and 1 Guest are viewing this topic.

smarko

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
    • http://hoito.org
How to sort users?
« 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;
}
Logged

Widi

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 32
    • http://www.widi.tk
How to sort users?
« Reply #1 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
Logged

smarko

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
    • http://hoito.org
How to sort users?
« Reply #2 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);
...
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 20 queries.