Index: modules/statistics.module =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics.module,v retrieving revision 1.202 diff -u -r1.202 statistics.module --- modules/statistics.module 1 Aug 2005 05:14:05 -0000 1.202 +++ modules/statistics.module 2 Aug 2005 21:48:44 -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', 'access statistics 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('access statistics 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;