From 18d22419f3da39ca4bf92f46d605a25957f311be Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 16 Dec 2008 22:05:51 +0000 Subject: - Patch #339929 by Moshe et al: move node links into ->content. --- modules/statistics/statistics.module | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'modules/statistics') 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; } /** -- cgit v1.2.3