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 @@
  • enable access log -- allows you to turn the access log on and off. This log is used to store data about every page accessed, such as the remote host's IP address, where they came from (referrer), what node they've viewed, and their user name. Enabling the log adds one database call per page displayed by Drupal.
  • discard access logs older than -- allows you to configure how long an access log entry is saved, after which time it is deleted from the database table. To use this you need to run \"cron.php\"
  • enable node view counter -- allows you to turn on and off the node-counting functionality of this module. If it is turned on, an extra database query is added for each node displayed, which increments a counter.
  • -
  • display node view counters -- allows you to globally disable the displaying of node view counters.
  • Popular content block

    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