diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-20 22:02:08 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-20 22:02:08 +0000 |
commit | de7c276845422154993e4983c87df3afb0b38757 (patch) | |
tree | bac1bbdb492a6126c199f04bbd5ed9ef6d41d041 /modules | |
parent | 374a4527387aafe4060fe2a7121a8e6429aa56da (diff) | |
download | brdo-de7c276845422154993e4983c87df3afb0b38757.tar.gz brdo-de7c276845422154993e4983c87df3afb0b38757.tar.bz2 |
#201055 by JirkaRybka, scor: avoid duplicates in stats when page caching is turned on or node title is modified
Diffstat (limited to 'modules')
-rw-r--r-- | modules/statistics/statistics.admin.inc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc index e2faf3a10..09b71162c 100644 --- a/modules/statistics/statistics.admin.inc +++ b/modules/statistics/statistics.admin.inc @@ -42,7 +42,8 @@ function statistics_recent_hits() { * Menu callback; presents the "top pages" page. */ function statistics_top_pages() { - $sql = "SELECT COUNT(path) AS hits, path, title, AVG(timer) AS average_time, SUM(timer) AS total_time FROM {accesslog} GROUP BY path, title"; + // MAX(title) avoids having empty node titles which otherwise causes duplicates in the top pages list + $sql = "SELECT COUNT(path) AS hits, path, MAX(title) AS title, AVG(timer) AS average_time, SUM(timer) AS total_time FROM {accesslog} GROUP BY path"; $sql_cnt = "SELECT COUNT(DISTINCT(path)) FROM {accesslog}"; $header = array( |