summaryrefslogtreecommitdiff
path: root/modules/statistics
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-12-16 22:05:51 +0000
committerDries Buytaert <dries@buytaert.net>2008-12-16 22:05:51 +0000
commit18d22419f3da39ca4bf92f46d605a25957f311be (patch)
treed72732b1a23d479c4f2adc4d671d8ec901e2a187 /modules/statistics
parent9fe9144ae7804e3b80c0ffd8444b0448261f4436 (diff)
downloadbrdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.gz
brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.bz2
- Patch #339929 by Moshe et al: move node links into ->content.
Diffstat (limited to 'modules/statistics')
-rw-r--r--modules/statistics/statistics.module16
1 files changed, 9 insertions, 7 deletions
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index dfb98bda2..98dab7531 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -96,20 +96,23 @@ function statistics_perm() {
}
/**
- * Implementation of hook_link().
+ * Implementation of hook_nodeapi_view().
*/
-function statistics_link($type, $node = NULL, $teaser = FALSE) {
+function statistics_nodeapi_view($node, $teaser, $page) {
global $id;
$links = array();
- if ($type != 'comment' && user_access('view post access counter')) {
+ if (user_access('view post access counter')) {
$statistics = statistics_get($node->nid);
if ($statistics) {
$links['statistics_counter']['title'] = format_plural($statistics['totalcount'], '1 read', '@count reads');
}
}
-
- return $links;
+
+ $node->content['links']['statistics'] = array(
+ '#type' => 'node_links',
+ '#value' => $links,
+ );
}
/**
@@ -244,9 +247,8 @@ function statistics_get($nid) {
if ($nid > 0) {
// Retrieve an array with both totalcount and daycount.
$statistics = db_fetch_array(db_query('SELECT totalcount, daycount, timestamp FROM {node_counter} WHERE nid = %d', $nid));
+ return $statistics;
}
-
- return $statistics;
}
/**