diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-06-22 18:13:04 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-06-22 18:13:04 +0000 |
commit | f6b7f7551220aa573ffb764dcf6c73163a409ec0 (patch) | |
tree | 93ae74cbe38e8ecabc84acabc5b98a453c9584f5 /modules/statistics/statistics.module | |
parent | 0be1e6cff7f3f82d99f247a1ed29b163667b551b (diff) | |
download | brdo-f6b7f7551220aa573ffb764dcf6c73163a409ec0.tar.gz brdo-f6b7f7551220aa573ffb764dcf6c73163a409ec0.tar.bz2 |
- Patch #8733 by Morbus Iff: fixed statistics module.
Diffstat (limited to 'modules/statistics/statistics.module')
-rw-r--r-- | modules/statistics/statistics.module | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 18bd2d6f3..6d75e7bbf 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -74,13 +74,13 @@ function statistics_exit() { if (variable_get('statistics_count_content_views', 0)) { // We are counting content views. - if ((arg(0) == 'node') && (arg(1) == 'view') && arg(2)) { + if ((arg(0) == 'node') && arg(1)) { // A node has been viewed, so update the node's counters. - db_query('UPDATE {node_counter} SET daycount = daycount + 1, totalcount = totalcount + 1, timestamp = %d WHERE nid = %d', time(), arg(2)); + db_query('UPDATE {node_counter} SET daycount = daycount + 1, totalcount = totalcount + 1, timestamp = %d WHERE nid = %d', time(), arg(1)); // If we affected 0 rows, this is the first time viewing the node. if (!db_affected_rows()) { // We must create a new row to store counters for the new node. - db_query('INSERT INTO {node_counter} (nid, daycount, totalcount, timestamp) VALUES(%d, 1, 1, %d)', arg(2), time()); + db_query('INSERT INTO {node_counter} (nid, daycount, totalcount, timestamp) VALUES(%d, 1, 1, %d)', arg(1), time()); } } } @@ -91,8 +91,8 @@ function statistics_exit() { $hostname = $_SERVER['REMOTE_ADDR']; // Log this page access. - if ((arg(0) == 'node') && (arg(1) == 'view') && arg(2)) { - db_query("INSERT INTO {accesslog} (nid, url, hostname, uid, timestamp) values(%d, '%s', '%s', %d, %d)", arg(2), $referrer, $hostname, $user->uid, time()); + if ((arg(0) == 'node') && arg(1)) { + db_query("INSERT INTO {accesslog} (nid, url, hostname, uid, timestamp) values(%d, '%s', '%s', %d, %d)", arg(1), $referrer, $hostname, $user->uid, time()); } else { db_query("INSERT INTO {accesslog} (url, hostname, uid, timestamp) values('%s', '%s', %d, %d)", $referrer, $hostname, $user->uid, time()); @@ -121,7 +121,7 @@ function statistics_link($type, $node = 0, $main = 0) { $links = array(); - if ($type == 'node' && user_access('access statistics') && variable_get('statistics_display_counter', 0)) { + if ($type != 'comment' && user_access('access statistics') && variable_get('statistics_display_counter', 0)) { $statistics = statistics_get($node->nid); if ($statistics) { if (user_access('administer statistics')) { |