Index: modules/statistics.module =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics.module,v retrieving revision 1.203 diff -u -r1.203 statistics.module --- modules/statistics.module 16 Aug 2005 19:48:04 -0000 1.203 +++ modules/statistics.module 17 Aug 2005 16:53:00 -0000 @@ -33,7 +33,6 @@
This module creates a block that can display the day's top viewed content, the all time top viewed content, and the last content viewed. Each of these links can be enabled or disabled individually, and the number of posts displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.
@@ -82,7 +81,7 @@ * Implementation of hook_perm(). */ function statistics_perm() { - return array('access statistics'); + return array('access statistics', 'view node access counter'); } /** @@ -90,15 +89,15 @@ */ function statistics_link($type, $node = 0, $main = 0) { global $id; - $links = array(); - if ($type != 'comment' && variable_get('statistics_display_counter', 0)) { + if ($type != 'comment' && user_access('view node access counter')) { $statistics = statistics_get($node->nid); if ($statistics) { $links[] = format_plural($statistics['totalcount'], '1 read', '%count reads'); } } + return $links; } @@ -344,7 +343,6 @@ // count content views settings $group = form_radios(t('Count content views'), 'statistics_count_content_views', variable_get('statistics_count_content_views', 0), array('1' => t('Enabled'), '0' => t('Disabled')), t('Increment a counter each time content is viewed.')); - $group .= form_radios(t('Display counter values'), 'statistics_display_counter', variable_get('statistics_display_counter', 0), array('1' => t('Enabled'), '0' => t('Disabled')), t('Display how many times given content has been viewed.')); $output .= form_group(t('Content viewing counter settings'), $group); return $output; @@ -489,4 +487,4 @@ } } -?> +?> \ No newline at end of file