You are here

function statistics_views_tables in Views (for Drupal 7) 5

This include file implements views functionality on behalf of statistics.module

File

modules/views_statistics.inc, line 7

Code

function statistics_views_tables() {
  $tables['node_counter'] = array(
    'name' => 'node_counter',
    'provider' => 'internal',
    // won't show up in external list.
    'join' => array(
      'left' => array(
        'table' => 'node',
        'field' => 'nid',
      ),
      'right' => array(
        'field' => 'nid',
      ),
    ),
    'fields' => array(
      'totalcount' => array(
        'name' => t('Node: Total Hits'),
        'sortable' => true,
        'help' => t('This will display the number of times a node has been read.'),
      ),
      'daycount' => array(
        'name' => t('Node: Recent Hits'),
        'sortable' => true,
        'help' => t('This will display the number of times a node has been read recently.'),
      ),
      'timestamp' => array(
        'name' => t('Node: Last Hit Time'),
        'sortable' => true,
        'handler' => views_handler_field_dates(),
        'option' => 'string',
        'help' => t('Display the time the node was last read.'),
      ),
    ),
    'sorts' => array(
      'totalcount' => array(
        'name' => t('Node: Total Hits'),
        'help' => t('This allows you to sort by the number of times a node has been read.'),
      ),
      'daycount' => array(
        'name' => t('Node: Recent Hits'),
        'help' => t('This allows you to sort by the number of times a node has been read recently.'),
      ),
      'timestamp' => array(
        'name' => t('Node: Last Hit Time'),
        'handler' => 'views_handler_sort_date',
        'option' => views_handler_sort_date_options(),
        'help' => t('This allows you to sort by the time a node was last read.'),
      ),
    ),
  );
  return $tables;
}