summaryrefslogtreecommitdiff
path: root/modules/statistics.module
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-01-07 05:39:33 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-01-07 05:39:33 +0000
commitee77417ff2fa4e100c373816ac1f740904657495 (patch)
treef7ffdefccabc10715427deb49053d94b494da5f2 /modules/statistics.module
parent859e045db6ead718e54bb66c3866ae7c3bf6d11a (diff)
downloadbrdo-ee77417ff2fa4e100c373816ac1f740904657495.tar.gz
brdo-ee77417ff2fa4e100c373816ac1f740904657495.tar.bz2
- #22565: Change statistics counter setting into permission
Diffstat (limited to 'modules/statistics.module')
-rw-r--r--modules/statistics.module8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/statistics.module b/modules/statistics.module
index 581147933..4e02f6fba 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -29,7 +29,6 @@ function statistics_help($section) {
<li>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.</li>
<li>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 <em>cron.php</em></li>
<li>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.</li>
-<li>Display node view counters allows you to globally disable the displaying of node view counters.</li>
</ul>
');
$output .= t('<p>You can</p>
@@ -85,7 +84,7 @@ function statistics_exit() {
* Implementation of hook_perm().
*/
function statistics_perm() {
- return array('access statistics');
+ return array('access statistics', 'view node access counter');
}
/**
@@ -93,15 +92,15 @@ function statistics_perm() {
*/
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;
}
@@ -337,7 +336,6 @@ function statistics_settings() {
// count content views settings
$form['content'] = array('#type' => 'fieldset', '#title' => t('Content viewing counter settings'));
$form['content']['statistics_count_content_views'] = array('#type' => 'radios', '#title' => t('Count content views'), '#default_value' => variable_get('statistics_count_content_views', 0), '#options' => $options, '#description' => t('Increment a counter each time content is viewed.'));
- $form['content']['statistics_display_counter'] = array('#type' => 'radios', '#title' => t('Display counter values'), '#default_value' => variable_get('statistics_display_counter', 0), '#options' => $options, '#description' => t('Display how many times given content has been viewed.'));
return $form;
}