diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-04-14 18:44:59 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-04-14 18:44:59 +0000 |
commit | 70f5b8649bbd6c7d115fbbf9c1976d9f82b4e8d4 (patch) | |
tree | eea2800600238d557c4d99f22764b20d88929183 /modules/statistics/statistics.module | |
parent | 2116f7a017e1dc6484b235045b2e4a6c9a6ea5c5 (diff) | |
download | brdo-70f5b8649bbd6c7d115fbbf9c1976d9f82b4e8d4.tar.gz brdo-70f5b8649bbd6c7d115fbbf9c1976d9f82b4e8d4.tar.bz2 |
A batch of changes:
- Renamed '---' to '<!--break-->'.
- Removed hard-coded call to the statistics module from the node module.
Patch by Gerhard.
- Removed tables from poll module. Modified patch by Al. Changes to Al's
patch are:
"polltext" -> "poll-text"
"pollfg" -> "poll-foreground"
"pollbg" -> "poll-background"
- Changed some 'statistics.foo's to 's.foo's. Patch by Gary.
[If this closes any bug reports, please update them on drupal.org.]
Diffstat (limited to 'modules/statistics/statistics.module')
-rw-r--r-- | modules/statistics/statistics.module | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 3ed28c4a6..8a3a4f916 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -326,7 +326,7 @@ function statistics_admin() { /* Displays the various admin tables */ function statistics_admin_count_table($dbfield, $dbrows) { - $result = db_query_range("SELECT statistics.nid, statistics.daycount, statistics.totalcount, statistics.timestamp, node.title FROM statistics LEFT JOIN node USING (nid) WHERE statistics.%s <> '0' ORDER BY statistics.%s DESC", $dbfield, $dbfield, 0, $dbrows); + $result = db_query_range("SELECT s.nid, s.daycount, s.totalcount, s.timestamp, n.title FROM statistics s LEFT JOIN node n USING (nid) WHERE s.%s <> '0' ORDER BY s.%s DESC", $dbfield, $dbfield, 0, $dbrows); $header = array(t("title"), t("today"), t("all time"), t("last hit"), t("operations")); @@ -789,7 +789,7 @@ function statistics_display_online_block() { /* Display linked title based on field name */ function statistics_title_list($dbfield, $dbrows) { /* valid dbfields: totalcount, daycount, timestamp */ - return db_query_range("SELECT statistics.nid, node.title, u.uid, u.name FROM statistics LEFT JOIN node ON statistics.nid = node.nid LEFT JOIN users u ON node.uid = u.uid WHERE %s <> '0' AND node.status = 1 ORDER BY %s DESC", "statistics.". $dbfield, "statistics.". $dbfield, 0, $dbrows); + return db_query_range("SELECT s.nid, n.title, u.uid, u.name FROM statistics s LEFT JOIN node n ON s.nid = n.nid LEFT JOIN users u ON n.uid = u.uid WHERE %s <> '0' AND n.status = 1 ORDER BY %s DESC", "s.". $dbfield, "s.". $dbfield, 0, $dbrows); } @@ -900,9 +900,12 @@ function statistics_summary($dbfield, $dbrows) { return $output; } -// clean up statistics table when node is deleted -function statistics_node_delete($nid) { - db_query("DELETE FROM statistics WHERE nid = '%d'", $nid); +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); + } } /* internal throttle function - do not call from other modules */ |