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

mrgoltra’s picture

subscribing. I am interested in this too.

sebori’s picture

Just change the following 2 code lines in avatar_blocks.module (add: "AND u.uid > 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.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:

$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);
  }

roopletheme’s picture

Status: Active » Postponed

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

tryitonce’s picture

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

AppleBag’s picture

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.