Hi,

Perhaps good to add to the readme.txt:

If you want the Counter Report but not show the Counter Block om every page (btw. without the block the module does not log at all!) you can do the following:

1) Enable the Counter block by moving it to a visible area in /admin/build/block.
2) Configure the block as
'Users cannot control whether or not they see this block'.
Do not select any roles (so everyone can see the counter block).

3) Now restrict visibibilty in a somewhat unusual way:
First check 'Show if the following PHP code returns TRUE (PHP-mode, experts only)'.
Then enter the following script un de PAGES:

if (module_exists('counter')) {
    counter_block('view');
}
global $user;
return $user->uid==1;

This script first updates the counters and then restricts its visibility to user #1 (the built-in admin) only!

Comments

simon_s’s picture

I think this should be a built in feature!
Normally site admins never want to show counter values to site visitors.

testnick’s picture

I Agree with kullerkeks. This Counter contain datas which are in most cases relevant only for site admins.

drupalnesia’s picture

Status: Active » Closed (fixed)

Added to 6.x-1.4 a new check box:
--> Show Site Counter Result for Administer group only = True/False

Thanks for suggestion!

jimmb’s picture

Thanks for this thread - very helpful!

One question - on Drupal 5, how would the code in the above description be modified to show access to all admins rather than just one (like the D6 method). I'm sure some adjustment would need to be made to:

return $user->uid==1;

But I'm not sure what.

Thanks,

Jim