Commit 420c27c4 authored by Dries's avatar Dries

- Patch #229051 by Josh Waihi, bellHead, ainigma32, Dave Reid, druido,...

- Patch #229051 by Josh Waihi, bellHead, ainigma32, Dave Reid, druido, ivanSB@drupal.org, jaydub: fixed 'Top visitor' page on PostgreSQL 8.3.
parent 6cb27792
......@@ -118,8 +118,10 @@ function statistics_top_visitors() {
->limit(30)
->orderByHeader($header);
$count_query = db_select('accesslog');
$count_query->addExpression('COUNT(DISTINCT CONCAT(CAST(uid AS char), hostname))');
$uniques_query = db_select('accesslog')->distinct();
$uniques_query->fields('accesslog', array('uid', 'hostname'));
$count_query = db_select($uniques_query);
$count_query->addExpression('COUNT(*)');
$query->setCountQuery($count_query);
$result = $query->execute();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment