--- avatar_blocks.module.orig 2010-01-11 19:33:19.000000000 +0100 +++ avatar_blocks.module 2010-01-11 19:38:49.000000000 +0100 @@ -303,11 +303,11 @@ if (!is_numeric($display_count)) { $display_count = 10; } - $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 ORDER BY s.timestamp DESC'; + $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 GROUP by u.uid 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'; + $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 <> "" GROUP by u.uid ORDER BY s.timestamp DESC'; $display_users = db_query_range($sql, $interval, 0, $display_count); } else {