Hello,

I'm trying to hide the user admin (uid 1) in the stats and I found this in advanced_forum.module

function advanced_forum_statistics_online_users() {
  $list = array();
  $interval = time() - variable_get('user_block_seconds_online', 900);
   $sql = 'SELECT DISTINCT u.uid, u.name, MAX(s.timestamp) as maxtime
            FROM {users} u
              INNER JOIN {sessions} s ON u.uid = s.uid
            WHERE s.timestamp >= %d AND s.uid > 0
            GROUP BY u.uid, u.name
           ORDER BY maxtime DESC';
  $authenticated_users = db_query($sql, $interval);
  while ($account = db_fetch_object($authenticated_users)) {
    $list[] = theme('username', $account);
  }
  return $list;
}

I change this line:

WHERE s.timestamp >= %d AND s.uid > 0

to

WHERE s.timestamp >= %d AND s.uid > 1

Is not hard to do, but is the only way? would be useful a GUI to hide users and roles.

Comments

michelle’s picture

Title: Hide user admin (uid 1) in stats » Allow for hidden users
Version: 6.x-1.1 » 6.x-2.x-dev
Status: Active » Postponed

I'm not going to make a setting just for that. At some point, if no one writes it first, I plan to make a seperate module for users to mark themselves hidden / invisible. At that point, AF as well as APK will hook into that.

If you want to do it without hacking the module, you could add a preprocess that sets that variable differently. That would mean both queries are running but it's a small query and shouldn't hurt performance any.

Michelle

RAFA3L’s picture

Thanks! but I prefer don't add more queries

michelle’s picture

Status: Postponed » Closed (won't fix)

Cleaning up the queue. If such a module ever gets done, this can be revisited then.

Michelle