Exclude user1 on Avatar Blocks

Liliplanet - November 3, 2008 - 14:12
Project:Avatar Blocks
Version:5.x-1.2
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed
Description

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

#1

mrgoltra - December 5, 2008 - 16:46

subscribing. I am interested in this too.

#2

sebori - January 17, 2009 - 00:02

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

roopletheme - January 29, 2009 - 09:08
Status:active» postponed

I'll add this as an option in the next release.

#4

tryitonce - April 25, 2009 - 18:05

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

AppleBag - April 22, 2009 - 06:05

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.

 
 

Drupal is a registered trademark of Dries Buytaert.