statistics.views.inc

Provide views data and handlers for statistics.module.

File

drupal/core/modules/statistics/statistics.views.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Provide views data and handlers for statistics.module.
  5. *
  6. * @ingroup views_module_handlers
  7. */
  8. /**
  9. * Implements hook_views_data().
  10. */
  11. function statistics_views_data() {
  12. $data['node_counter']['table']['group'] = t('Content statistics');
  13. $data['node_counter']['table']['join'] = array(
  14. 'node' => array(
  15. 'left_field' => 'nid',
  16. 'field' => 'nid',
  17. ),
  18. );
  19. $data['node_counter']['totalcount'] = array(
  20. 'title' => t('Total views'),
  21. 'help' => t('The total number of times the node has been viewed.'),
  22. 'field' => array(
  23. 'id' => 'numeric',
  24. 'click sortable' => TRUE,
  25. ),
  26. 'filter' => array(
  27. 'id' => 'numeric',
  28. ),
  29. 'argument' => array(
  30. 'id' => 'numeric',
  31. ),
  32. 'sort' => array(
  33. 'id' => 'standard',
  34. ),
  35. );
  36. $data['node_counter']['daycount'] = array(
  37. 'title' => t('Views today'),
  38. 'help' => t('The total number of times the node has been viewed today.'),
  39. 'field' => array(
  40. 'id' => 'numeric',
  41. 'click sortable' => TRUE,
  42. ),
  43. 'filter' => array(
  44. 'id' => 'numeric',
  45. ),
  46. 'argument' => array(
  47. 'id' => 'numeric',
  48. ),
  49. 'sort' => array(
  50. 'id' => 'standard',
  51. ),
  52. );
  53. $data['node_counter']['timestamp'] = array(
  54. 'title' => t('Most recent view'),
  55. 'help' => t('The most recent time the node has been viewed.'),
  56. 'field' => array(
  57. 'id' => 'date',
  58. 'click sortable' => TRUE,
  59. ),
  60. 'filter' => array(
  61. 'id' => 'date',
  62. ),
  63. 'argument' => array(
  64. 'id' => 'date',
  65. ),
  66. 'sort' => array(
  67. 'id' => 'standard',
  68. ),
  69. );
  70. return $data;
  71. }

Related topics

Functions

Namesort descending Description
statistics_views_data Implements hook_views_data().