You are here

function statistics_access_logging_settings in Drupal 5

Same name and namespace in other branches
  1. 6 modules/statistics/statistics.admin.inc \statistics_access_logging_settings()
1 string reference to 'statistics_access_logging_settings'
statistics_menu in modules/statistics/statistics.module
Implementation of hook_menu().

File

modules/statistics/statistics.module, line 361
Logs access statistics for your site.

Code

function statistics_access_logging_settings() {

  // Access log settings:
  $options = array(
    '1' => t('Enabled'),
    '0' => t('Disabled'),
  );
  $form['access'] = array(
    '#type' => 'fieldset',
    '#title' => t('Access log settings'),
  );
  $form['access']['statistics_enable_access_log'] = array(
    '#type' => 'radios',
    '#title' => t('Enable access log'),
    '#default_value' => variable_get('statistics_enable_access_log', 0),
    '#options' => $options,
    '#description' => t('Log each page access. Required for referrer statistics.'),
  );
  $period = drupal_map_assoc(array(
    3600,
    10800,
    21600,
    32400,
    43200,
    86400,
    172800,
    259200,
    604800,
    1209600,
    2419200,
    4838400,
    9676800,
  ), 'format_interval');
  $form['access']['statistics_flush_accesslog_timer'] = array(
    '#type' => 'select',
    '#title' => t('Discard access logs older than'),
    '#default_value' => variable_get('statistics_flush_accesslog_timer', 259200),
    '#options' => $period,
    '#description' => t('Older access log entries (including referrer statistics) will be automatically discarded. Requires crontab.'),
  );

  // 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.'),
  );
  return system_settings_form($form);
}