statistics.views_default.inc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <?php
  2. /**
  3. * @file
  4. * Bulk export of views_default objects generated by Bulk export module.
  5. */
  6. /**
  7. * Implementation of hook_views_default_views()
  8. */
  9. function statistics_views_default_views() {
  10. $views = array();
  11. $view = new view;
  12. $view->name = 'popular';
  13. $view->description = 'Shows the most-viewed nodes on the site. This requires the statistics to be enabled at administer >> reports >> access log settings.';
  14. $view->tag = 'default';
  15. $view->base_table = 'node';
  16. $view->human_name = 'Popular content';
  17. $view->core = 0;
  18. $view->api_version = '3.0';
  19. $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
  20. /* Display: Master */
  21. $handler = $view->new_display('default', 'Master', 'default');
  22. $handler->display->display_options['title'] = 'Popular content';
  23. $handler->display->display_options['use_more'] = TRUE;
  24. $handler->display->display_options['access']['type'] = 'none';
  25. $handler->display->display_options['cache']['type'] = 'none';
  26. $handler->display->display_options['query']['type'] = 'views_query';
  27. $handler->display->display_options['query']['options']['query_comment'] = FALSE;
  28. $handler->display->display_options['exposed_form']['type'] = 'basic';
  29. $handler->display->display_options['pager']['type'] = 'full';
  30. $handler->display->display_options['pager']['options']['items_per_page'] = '25';
  31. $handler->display->display_options['style_plugin'] = 'table';
  32. $handler->display->display_options['style_options']['columns'] = array(
  33. 'type' => 'type',
  34. 'title' => 'title',
  35. 'name' => 'name',
  36. 'timestamp' => 'title',
  37. 'totalcount' => 'totalcount',
  38. );
  39. $handler->display->display_options['style_options']['default'] = '-1';
  40. $handler->display->display_options['style_options']['info'] = array(
  41. 'type' => array(
  42. 'sortable' => 0,
  43. 'separator' => '',
  44. ),
  45. 'title' => array(
  46. 'sortable' => 0,
  47. 'separator' => '',
  48. ),
  49. 'name' => array(
  50. 'sortable' => 0,
  51. 'separator' => '',
  52. ),
  53. 'timestamp' => array(
  54. 'separator' => '',
  55. ),
  56. 'totalcount' => array(
  57. 'sortable' => 0,
  58. 'separator' => '',
  59. ),
  60. );
  61. $handler->display->display_options['style_options']['override'] = 0;
  62. $handler->display->display_options['style_options']['order'] = 'desc';
  63. /* Field: Content: Type */
  64. $handler->display->display_options['fields']['type']['id'] = 'type';
  65. $handler->display->display_options['fields']['type']['table'] = 'node';
  66. $handler->display->display_options['fields']['type']['field'] = 'type';
  67. /* Field: Content: Title */
  68. $handler->display->display_options['fields']['title']['id'] = 'title';
  69. $handler->display->display_options['fields']['title']['table'] = 'node';
  70. $handler->display->display_options['fields']['title']['field'] = 'title';
  71. /* Field: User: Name */
  72. $handler->display->display_options['fields']['name']['id'] = 'name';
  73. $handler->display->display_options['fields']['name']['table'] = 'users';
  74. $handler->display->display_options['fields']['name']['field'] = 'name';
  75. $handler->display->display_options['fields']['name']['label'] = 'Author';
  76. /* Field: Content: Has new content */
  77. $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
  78. $handler->display->display_options['fields']['timestamp']['table'] = 'history';
  79. $handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
  80. $handler->display->display_options['fields']['timestamp']['label'] = '';
  81. $handler->display->display_options['fields']['timestamp']['link_to_node'] = 0;
  82. $handler->display->display_options['fields']['timestamp']['comments'] = 1;
  83. /* Sort criterion: Content statistics: Total views */
  84. $handler->display->display_options['sorts']['totalcount']['id'] = 'totalcount';
  85. $handler->display->display_options['sorts']['totalcount']['table'] = 'node_counter';
  86. $handler->display->display_options['sorts']['totalcount']['field'] = 'totalcount';
  87. $handler->display->display_options['sorts']['totalcount']['order'] = 'DESC';
  88. /* Filter criterion: Content: Published */
  89. $handler->display->display_options['filters']['status']['id'] = 'status';
  90. $handler->display->display_options['filters']['status']['table'] = 'node';
  91. $handler->display->display_options['filters']['status']['field'] = 'status';
  92. $handler->display->display_options['filters']['status']['value'] = '1';
  93. $handler->display->display_options['filters']['status']['group'] = 0;
  94. $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
  95. /* Filter criterion: Content statistics: Total views */
  96. $handler->display->display_options['filters']['totalcount']['id'] = 'totalcount';
  97. $handler->display->display_options['filters']['totalcount']['table'] = 'node_counter';
  98. $handler->display->display_options['filters']['totalcount']['field'] = 'totalcount';
  99. $handler->display->display_options['filters']['totalcount']['operator'] = '>';
  100. $handler->display->display_options['filters']['totalcount']['value']['value'] = '0';
  101. $handler->display->display_options['filters']['totalcount']['group'] = 0;
  102. $handler->display->display_options['filters']['totalcount']['expose']['operator'] = FALSE;
  103. /* Display: Popular (page) */
  104. $handler = $view->new_display('page', 'Popular (page)', 'page');
  105. $handler->display->display_options['path'] = 'popular/all';
  106. $handler->display->display_options['menu']['type'] = 'default tab';
  107. $handler->display->display_options['menu']['title'] = 'Popular content';
  108. $handler->display->display_options['menu']['weight'] = '-1';
  109. $handler->display->display_options['tab_options']['type'] = 'normal';
  110. $handler->display->display_options['tab_options']['title'] = 'Popular content';
  111. $handler->display->display_options['tab_options']['weight'] = '';
  112. /* Display: Today (page) */
  113. $handler = $view->new_display('page', 'Today (page)', 'page_1');
  114. $handler->display->display_options['defaults']['fields'] = FALSE;
  115. /* Field: Content: Type */
  116. $handler->display->display_options['fields']['type']['id'] = 'type';
  117. $handler->display->display_options['fields']['type']['table'] = 'node';
  118. $handler->display->display_options['fields']['type']['field'] = 'type';
  119. /* Field: Content: Title */
  120. $handler->display->display_options['fields']['title']['id'] = 'title';
  121. $handler->display->display_options['fields']['title']['table'] = 'node';
  122. $handler->display->display_options['fields']['title']['field'] = 'title';
  123. /* Field: User: Name */
  124. $handler->display->display_options['fields']['name']['id'] = 'name';
  125. $handler->display->display_options['fields']['name']['table'] = 'users';
  126. $handler->display->display_options['fields']['name']['field'] = 'name';
  127. $handler->display->display_options['fields']['name']['label'] = 'Author';
  128. /* Field: Content: Has new content */
  129. $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
  130. $handler->display->display_options['fields']['timestamp']['table'] = 'history';
  131. $handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
  132. $handler->display->display_options['fields']['timestamp']['label'] = '';
  133. $handler->display->display_options['fields']['timestamp']['link_to_node'] = 0;
  134. $handler->display->display_options['fields']['timestamp']['comments'] = 1;
  135. /* Field: Content statistics: Views today */
  136. $handler->display->display_options['fields']['daycount']['id'] = 'daycount';
  137. $handler->display->display_options['fields']['daycount']['table'] = 'node_counter';
  138. $handler->display->display_options['fields']['daycount']['field'] = 'daycount';
  139. $handler->display->display_options['defaults']['sorts'] = FALSE;
  140. /* Sort criterion: Content statistics: Views today */
  141. $handler->display->display_options['sorts']['daycount']['id'] = 'daycount';
  142. $handler->display->display_options['sorts']['daycount']['table'] = 'node_counter';
  143. $handler->display->display_options['sorts']['daycount']['field'] = 'daycount';
  144. $handler->display->display_options['sorts']['daycount']['order'] = 'DESC';
  145. $handler->display->display_options['path'] = 'popular/today';
  146. $handler->display->display_options['menu']['type'] = 'tab';
  147. $handler->display->display_options['menu']['title'] = 'Today\'s popular content';
  148. $handler->display->display_options['menu']['weight'] = '0';
  149. $handler->display->display_options['tab_options']['type'] = 'normal';
  150. $handler->display->display_options['tab_options']['title'] = 'Popular content';
  151. $handler->display->display_options['tab_options']['weight'] = '0';
  152. /* Display: Popular (block) */
  153. $handler = $view->new_display('block', 'Popular (block)', 'block');
  154. $handler->display->display_options['defaults']['style_plugin'] = FALSE;
  155. $handler->display->display_options['style_plugin'] = 'list';
  156. $handler->display->display_options['defaults']['style_options'] = FALSE;
  157. $handler->display->display_options['defaults']['row_plugin'] = FALSE;
  158. $handler->display->display_options['row_plugin'] = 'fields';
  159. $handler->display->display_options['row_options']['inline'] = array(
  160. 'title' => 'title',
  161. 'totalcount' => 'totalcount',
  162. );
  163. $handler->display->display_options['defaults']['row_options'] = FALSE;
  164. $handler->display->display_options['defaults']['fields'] = FALSE;
  165. /* Field: Content: Title */
  166. $handler->display->display_options['fields']['title']['id'] = 'title';
  167. $handler->display->display_options['fields']['title']['table'] = 'node';
  168. $handler->display->display_options['fields']['title']['field'] = 'title';
  169. $handler->display->display_options['fields']['title']['label'] = '';
  170. $handler->display->display_options['fields']['title']['link_to_node'] = 1;
  171. /* Field: Content statistics: Total views */
  172. $handler->display->display_options['fields']['totalcount']['id'] = 'totalcount';
  173. $handler->display->display_options['fields']['totalcount']['table'] = 'node_counter';
  174. $handler->display->display_options['fields']['totalcount']['field'] = 'totalcount';
  175. $handler->display->display_options['fields']['totalcount']['label'] = '';
  176. $handler->display->display_options['fields']['totalcount']['prefix'] = ' (';
  177. $handler->display->display_options['fields']['totalcount']['suffix'] = ')';
  178. /* Display: Today (block) */
  179. $handler = $view->new_display('block', 'Today (block)', 'block_1');
  180. $handler->display->display_options['defaults']['title'] = FALSE;
  181. $handler->display->display_options['title'] = 'Today\'s popular content';
  182. $handler->display->display_options['defaults']['link_display'] = FALSE;
  183. $handler->display->display_options['link_display'] = 'page_1';
  184. $handler->display->display_options['defaults']['style_plugin'] = FALSE;
  185. $handler->display->display_options['style_plugin'] = 'list';
  186. $handler->display->display_options['defaults']['style_options'] = FALSE;
  187. $handler->display->display_options['defaults']['row_plugin'] = FALSE;
  188. $handler->display->display_options['row_plugin'] = 'fields';
  189. $handler->display->display_options['row_options']['inline'] = array(
  190. 'title' => 'title',
  191. 'daycount' => 'daycount',
  192. );
  193. $handler->display->display_options['defaults']['row_options'] = FALSE;
  194. $handler->display->display_options['defaults']['fields'] = FALSE;
  195. /* Field: Content: Title */
  196. $handler->display->display_options['fields']['title']['id'] = 'title';
  197. $handler->display->display_options['fields']['title']['table'] = 'node';
  198. $handler->display->display_options['fields']['title']['field'] = 'title';
  199. $handler->display->display_options['fields']['title']['label'] = '';
  200. $handler->display->display_options['fields']['title']['link_to_node'] = 1;
  201. /* Field: Content statistics: Views today */
  202. $handler->display->display_options['fields']['daycount']['id'] = 'daycount';
  203. $handler->display->display_options['fields']['daycount']['table'] = 'node_counter';
  204. $handler->display->display_options['fields']['daycount']['field'] = 'daycount';
  205. $handler->display->display_options['fields']['daycount']['label'] = '';
  206. $handler->display->display_options['fields']['daycount']['prefix'] = ' (';
  207. $handler->display->display_options['fields']['daycount']['suffix'] = ')';
  208. $handler->display->display_options['defaults']['sorts'] = FALSE;
  209. /* Sort criterion: Content statistics: Views today */
  210. $handler->display->display_options['sorts']['daycount']['id'] = 'daycount';
  211. $handler->display->display_options['sorts']['daycount']['table'] = 'node_counter';
  212. $handler->display->display_options['sorts']['daycount']['field'] = 'daycount';
  213. $handler->display->display_options['sorts']['daycount']['order'] = 'DESC';
  214. $translatables['popular'] = array(
  215. t('Master'),
  216. t('Popular content'),
  217. t('more'),
  218. t('Apply'),
  219. t('Reset'),
  220. t('Sort by'),
  221. t('Asc'),
  222. t('Desc'),
  223. t('Items per page'),
  224. t('- All -'),
  225. t('Offset'),
  226. t('Type'),
  227. t('Title'),
  228. t('Author'),
  229. t('Popular (page)'),
  230. t('Today (page)'),
  231. t('Views today'),
  232. t('.'),
  233. t(','),
  234. t('Popular (block)'),
  235. t(' ('),
  236. t(')'),
  237. t('Today (block)'),
  238. t('Today\'s popular content'),
  239. );
  240. $views['popular'] = $view;
  241. return $views;
  242. }