Index: statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics.module,v
retrieving revision 1.196
diff -u -Ffunction -r1.196 statistics.module
--- statistics.module	7 Jun 2005 18:54:37 -0000	1.196
+++ statistics.module	9 Jun 2005 13:44:10 -0000
@@ -90,13 +90,29 @@ function statistics_perm() {
  */
 function statistics_link($type, $node = 0, $main = 0) {
   global $id;
+  global $user;
+  $allowprint = 0;
 
   $links = array();
-
-  if ($type != 'comment' && variable_get('statistics_display_counter', 0)) {
-    $statistics = statistics_get($node->nid);
-    if ($statistics) {
-      $links[] = format_plural($statistics['totalcount'], '1 read', '%count reads');
+  
+  if ($type != 'comment') {
+    switch (variable_get('statistics_display_counter', 0)) {
+      case 3:
+        if (!user_access('access statistics')) {
+          break;
+        }
+      case 2:
+        if (!$user->uid){
+          break;
+        }
+      case 1:
+        $statistics = statistics_get($node->nid);
+        if ($statistics) {
+          $links[] = format_plural($statistics['totalcount'], '1 read', '%count reads');
+        }
+        break;
+      default:
+        break;
     }
   }
   return $links;
@@ -344,7 +360,7 @@ function statistics_settings() {
 
   // 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.'));
+  $group .= form_radios(t('Display counter values'), 'statistics_display_counter', variable_get('statistics_display_counter', 0), array('1' => t('For all users'), '2' => t('For authenticated users'), '3' => t('For priviledged users'), '0' => t('Disabled')), t('Display how many times given content has been viewed.'));
   $output .= form_group(t('Content viewing counter settings'), $group);
 
   return $output;
