From 43db9cf86fdfba736117cda501c6eb1d31d04693 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 3 Jul 2001 19:16:20 +0000 Subject: - common.inc: + Made '$na' translatable on popular demand. - node.module: + replaced a confusing configuration description, as suggested by Remco. - statistics.module: + Added a 'most recent referers'-table sorted by timestamp. - drupal.module: + Small update of the links. --- modules/statistics/statistics.module | 38 ++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'modules/statistics/statistics.module') diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index d23e7b22c..f5acfaacc 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -29,25 +29,21 @@ function statistics_conf_options() { return $output; } -function statistics_referer_internal() { - $result = db_query("SELECT url, COUNT(url) AS count FROM referer WHERE url LIKE '". path_uri() ."%' GROUP BY url ORDER BY count DESC"); - - $output .= "

Internal referers of the last ". format_interval(variable_get("referer_clear", 604800)) .":

\n"; +function statistics_table_1($query) { + $result = db_query($query); $output .= "\n"; - $output .= " \n"; + $output .= " \n"; while ($referer = db_fetch_object($result)) { - $output .= ""; + $output .= ""; } $output .= "
URLnumber
URLdate
url) ."\">". substr(check_output($referer->url), 0, 100) ."". check_output($referer->count) ."
url) ."\">". substr(check_output($referer->url), 0, 100) ."". format_date($referer->timestamp, "small") ."
\n"; return $output; } -function statistics_referer_external() { - $result = db_query("SELECT url, COUNT(url) AS count FROM referer WHERE url NOT LIKE '". path_uri() ."%' GROUP BY url ORDER BY count DESC"); - - $output .= "

External referers of the last ". format_interval(variable_get("referer_clear", 604800)) .":

\n"; +function statistics_table_2($query) { + $result = db_query($query); $output .= "\n"; $output .= " \n"; @@ -59,6 +55,28 @@ function statistics_referer_external() { return $output; } +function statistics_referer_internal() { + $output .= "

Most recent referers

\n"; + $output .= statistics_table_1("SELECT url, timestamp FROM referer WHERE url LIKE '". path_uri() ."%' ORDER BY timestamp DESC LIMIT 15"); + + $output .= "

Referers of the last ". format_interval(variable_get("referer_clear", 604800)) ."

\n"; + $output .= statistics_table_2("SELECT url, COUNT(url) AS count FROM referer WHERE url LIKE '". path_uri() ."%' GROUP BY url ORDER BY count DESC"); + + return $output; +} + +function statistics_referer_external() { + $result = db_query("SELECT url, COUNT(url) AS count FROM referer WHERE url NOT LIKE '". path_uri() ."%' GROUP BY url ORDER BY count DESC"); + + $output .= "

Most recent referers

\n"; + $output .= statistics_table_1("SELECT url, timestamp FROM referer WHERE url NOT LIKE '". path_uri() ."%' ORDER BY timestamp DESC LIMIT 15"); + + $output .= "

Referers of the last ". format_interval(variable_get("referer_clear", 604800)) ."

\n"; + $output .= statistics_table_2("SELECT url, COUNT(url) AS count FROM referer WHERE url NOT LIKE '". path_uri() ."%' GROUP BY url ORDER BY count DESC"); + + return $output; +} + function statistics_admin() { global $type; -- cgit v1.2.3
URLnumber