Added DISTINCT clause to whoisonline query to avoid repeated users - refs BT#5878

skala
Yannick Warnier 12 years ago
parent 750a4c5d40
commit af80e81528
  1. 4
      main/inc/lib/online.inc.php

@ -194,7 +194,7 @@ function who_is_online($from, $number_of_items, $column = null, $direction = nul
ORDER BY $column $direction
LIMIT $from, $number_of_items";
} else {
$query = "SELECT login_user_id, login_date FROM ".$track_online_table ." e INNER JOIN ".$table_user ." u ON (u.user_id=e.login_user_id)
$query = "SELECT DISTINCT login_user_id, login_date FROM ".$track_online_table ." e INNER JOIN ".$table_user ." u ON (u.user_id=e.login_user_id)
WHERE u.status != ".ANONYMOUS." AND login_date >= '".$current_date."'
ORDER BY $column $direction
LIMIT $from, $number_of_items";
@ -445,4 +445,4 @@ function chatcall() {
} else {
return false;
}
}
}

Loading…
Cancel
Save