Posted by Liliplanet on November 3, 2008 at 2:12pm
Jump to:
| Project: | Avatar Blocks |
| Version: | 5.x-1.2 |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Issue Summary
Beautiful module, thank you.
Please, how do I exclude (hide) user1 for users online?
Will obviously be online all the time (as admin) and prefer to be invisible in this case.
Look forward to your reply.
Lilian
Comments
#1
subscribing. I am interested in this too.
#2
Just change the following 2 code lines in avatar_blocks.module (add: "AND u.uid > 0"):
<?php$sql = 'SELECT DISTINCT u.uid, u.name, u.picture, s.timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 AND u.uid > 1 ORDER BY s.timestamp DESC';
$authenticated_users = db_query_range($sql, $interval, 0, $display_count);
$authenticated_count = db_num_rows($authenticated_users);
if (variable_get('avatar_blocks_ol_display_noavatar', 1) == 0) {
$sql = 'SELECT DISTINCT u.uid, u.name, u.picture, s.timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 AND u.picture <> "" ORDER BY s.timestamp DESC';
$display_users = db_query_range($sql, $interval, 0, $display_count);
}
?>
into:
<?php$sql = 'SELECT DISTINCT u.uid, u.name, u.picture, s.timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 AND u.uid > 1 ORDER BY s.timestamp DESC'; /*here is the first change*/
$authenticated_users = db_query_range($sql, $interval, 0, $display_count);
$authenticated_count = db_num_rows($authenticated_users);
if (variable_get('avatar_blocks_ol_display_noavatar', 1) == 0) {
$sql = 'SELECT DISTINCT u.uid, u.name, u.picture, s.timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= %d AND s.uid > 0 AND u.picture <> "" AND u.uid > 1 ORDER BY s.timestamp DESC'; /*here is the second change*/
$display_users = db_query_range($sql, $interval, 0, $display_count);
}
?>
#3
I'll add this as an option in the next release.
#4
It might be useful to add a role based option to exclude certain levels or at least their status.
One my side I would like to exclude all administrators from public view.
Some administrators may just be technical and should not be involved in the activity around the site. Those administrators that have both function could then get a second for their participation on the regular activety around the site.
Thanks
#5
Is this module dead in the water? I'd also love to see a role option for this. Then just add the permission to the user to hide them form the online now blocks.