From 1bcc0e36ad00c534eeff22fd23e405b18ce0a2e9 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Fri, 27 Dec 2013 14:15:52 -0500 Subject: Issue #1209532 by timmillwood, lucascaro, wiifm, iamEAP, sdrycroft, mikeytown2 | slashrsm: Count node views via AJAX in the statistics module. --- modules/statistics/statistics.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 modules/statistics/statistics.php (limited to 'modules/statistics/statistics.php') diff --git a/modules/statistics/statistics.php b/modules/statistics/statistics.php new file mode 100644 index 000000000..f00e03976 --- /dev/null +++ b/modules/statistics/statistics.php @@ -0,0 +1,31 @@ +key(array('nid' => $nid)) + ->fields(array( + 'daycount' => 1, + 'totalcount' => 1, + 'timestamp' => REQUEST_TIME, + )) + ->expression('daycount', 'daycount + 1') + ->expression('totalcount', 'totalcount + 1') + ->execute(); + } +} -- cgit v1.2.3