diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-01-04 23:38:58 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-01-04 23:38:58 +0000 |
commit | 2da18e8d0c1026143b85518f323c26cad55865f0 (patch) | |
tree | 7c28261dc2c57000cced29cbb4cf94b765734f79 | |
parent | 8a636465767fc47f37a0768d45b86ca53a722085 (diff) | |
download | brdo-2da18e8d0c1026143b85518f323c26cad55865f0.tar.gz brdo-2da18e8d0c1026143b85518f323c26cad55865f0.tar.bz2 |
- The statistics module would sometimes mistake a non-node ID with that
of a node. Thanks David and Jeremy.
-rw-r--r-- | modules/statistics.module | 7 | ||||
-rw-r--r-- | modules/statistics/statistics.module | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/modules/statistics.module b/modules/statistics.module index ec27e9eaf..af6387480 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -23,7 +23,12 @@ function statistics_init() { $referrer = getenv("HTTP_REFERER"); $hostname = getenv("REMOTE_ADDR"); // log this page access - db_query("INSERT INTO accesslog (nid, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', '%s')", $id, $referrer, $hostname, $user->uid, time()); + if (isset($id) && empty($mod)) { + db_query("INSERT INTO accesslog (nid, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', '%s')", $id, $referrer, $hostname, $user->uid, time()); + } + else { + db_query("INSERT INTO accesslog (url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s')", $referrer, $hostname, $user->uid, time()); + } } /* diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index ec27e9eaf..af6387480 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -23,7 +23,12 @@ function statistics_init() { $referrer = getenv("HTTP_REFERER"); $hostname = getenv("REMOTE_ADDR"); // log this page access - db_query("INSERT INTO accesslog (nid, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', '%s')", $id, $referrer, $hostname, $user->uid, time()); + if (isset($id) && empty($mod)) { + db_query("INSERT INTO accesslog (nid, url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s', '%s')", $id, $referrer, $hostname, $user->uid, time()); + } + else { + db_query("INSERT INTO accesslog (url, hostname, uid, timestamp) values('%s', '%s', '%s', '%s')", $referrer, $hostname, $user->uid, time()); + } } /* |