summaryrefslogtreecommitdiff
path: root/modules/statistics.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-05-07 21:00:36 +0000
committerDries Buytaert <dries@buytaert.net>2003-05-07 21:00:36 +0000
commita161110a6ba10a43df67179263d62f201631e88d (patch)
treec6b146ed125d82487d6285c259cfb30346c310bc /modules/statistics.module
parent9a62873a4beae8fe620dedcf7ca40954e12cc7cb (diff)
downloadbrdo-a161110a6ba10a43df67179263d62f201631e88d.tar.gz
brdo-a161110a6ba10a43df67179263d62f201631e88d.tar.bz2
- Applied Michael Caerwyn's "%s -> %d" patch.
- Changed all occurences of '%d' to %d as suggested on the mailing list.
Diffstat (limited to 'modules/statistics.module')
-rw-r--r--modules/statistics.module14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/statistics.module b/modules/statistics.module
index b0771d3aa..4c6a6fb77 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -42,11 +42,11 @@ function statistics_exit() {
// node view counters are enabled
if ((arg(0) == "node") && (arg(1) == "view") && arg(2)) {
// a node has been viewed, so updated the node's counters
- db_query("UPDATE statistics SET daycount = daycount + 1, totalcount = totalcount + 1, timestamp = '%d' WHERE nid = '%d'", time(), arg(2));
+ db_query("UPDATE statistics SET daycount = daycount + 1, totalcount = totalcount + 1, timestamp = %d WHERE nid = %d", time(), arg(2));
// if we affected 0 rows, this is the first time viewing the node
if (!db_affected_rows()) {
// must create a new row to store counter's for new node
- db_query("INSERT INTO statistics (nid, daycount, totalcount) VALUES('%d', daycount + 1, totalcount + 1)", arg(2));
+ db_query("INSERT INTO statistics (nid, daycount, totalcount) VALUES(%d, daycount + 1, totalcount + 1)", arg(2));
}
}
}
@@ -57,10 +57,10 @@ function statistics_exit() {
$hostname = getenv("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());
+ db_query("INSERT INTO accesslog (nid, url, hostname, uid, timestamp) values(%d, '%s', '%s', %d, %d)", arg(2), $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());
+ db_query("INSERT INTO accesslog (url, hostname, uid, timestamp) values('%s', '%s', %d, %d)", $referrer, $hostname, $user->uid, time());
}
}
}
@@ -736,7 +736,7 @@ function statistics_display_online_block() {
** This call gathers all the info we need on users/guests in a single
** database call, thus is quite efficient.
*/
- $result = db_query("SELECT COUNT(DISTINCT hostname) AS count, uid, MAX(timestamp) AS max_timestamp FROM accesslog WHERE timestamp >= '%d' GROUP BY uid ORDER BY max_timestamp DESC", (time() - $time_period));
+ $result = db_query("SELECT COUNT(DISTINCT hostname) AS count, uid, MAX(timestamp) AS max_timestamp FROM accesslog WHERE timestamp >= %d GROUP BY uid ORDER BY max_timestamp DESC", (time() - $time_period));
$users = $guests = 0;
/* Count number of users & guests currently online based on db query */
@@ -800,7 +800,7 @@ function statistics_get($nid) {
if ($nid > 0) {
/* retrieves an array with both totalcount and daycount */
- $statistics = db_fetch_array(db_query("SELECT totalcount, daycount, timestamp FROM statistics WHERE nid = '%d'", $nid));
+ $statistics = db_fetch_array(db_query("SELECT totalcount, daycount, timestamp FROM statistics WHERE nid = %d", $nid));
}
return $statistics;
@@ -904,7 +904,7 @@ function statistics_nodeapi(&$node, $op, $arg = 0) {
switch ($op) {
case "delete":
// clean up statistics table when node is deleted
- db_query("DELETE FROM statistics WHERE nid = '%d'", $node->nid);
+ db_query("DELETE FROM statistics WHERE nid = %d", $node->nid);
}
}