Posted by RAFA3L on July 9, 2009 at 5:24pm
Jump to:
| Project: | Advanced Forum |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
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 > 0to
WHERE s.timestamp >= %d AND s.uid > 1Is not hard to do, but is the only way? would be useful a GUI to hide users and roles.
Comments
#1
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
#2
Thanks! but I prefer don't add more queries
#3
Cleaning up the queue. If such a module ever gets done, this can be revisited then.
Michelle