user_stats.views_default.inc 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276
  1. <?php
  2. /**
  3. * @file
  4. * Default views provided by the User Stats module.
  5. */
  6. /**
  7. * Implements hook_views_default_views().
  8. */
  9. function user_stats_views_default_views() {
  10. /*
  11. * View 'user_stats_ips_by_user'
  12. */
  13. $view = new view;
  14. $view->name = 'user_stats_ips_by_user';
  15. $view->description = 'IP addresses grouped by user. Shows the IP addresses the user has logged in under and the number of users with the same IP. This views works in conjunction with user_stats_users_by_ip and will not work correctly unless it is also enabled.';
  16. $view->tag = '';
  17. $view->view_php = '';
  18. $view->base_table = 'users';
  19. $view->is_cacheable = FALSE;
  20. $view->api_version = 2;
  21. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  22. $handler = $view->new_display('default', 'Defaults', 'default');
  23. $handler->override_option('fields', array(
  24. 'name' => array(
  25. 'label' => 'Name',
  26. 'alter' => array(
  27. 'alter_text' => 1,
  28. 'text' => '<strong>[name]</strong>',
  29. 'make_link' => 0,
  30. 'path' => '',
  31. 'alt' => '',
  32. 'prefix' => '',
  33. 'suffix' => '',
  34. 'help' => '',
  35. 'trim' => 0,
  36. 'max_length' => '',
  37. 'word_boundary' => 1,
  38. 'ellipsis' => 1,
  39. 'html' => 0,
  40. ),
  41. 'link_to_user' => 1,
  42. 'exclude' => 1,
  43. 'id' => 'name',
  44. 'table' => 'users',
  45. 'field' => 'name',
  46. 'relationship' => 'none',
  47. ),
  48. 'ip_address' => array(
  49. 'label' => 'IP',
  50. 'alter' => array(
  51. 'alter_text' => 0,
  52. 'text' => '',
  53. 'make_link' => 1,
  54. 'path' => 'admin/reports/ip_tracking/by_ip/[ip_address]',
  55. 'link_class' => '',
  56. 'alt' => 'View other users with this IP address',
  57. 'prefix' => '',
  58. 'suffix' => '',
  59. 'target' => '',
  60. 'help' => '',
  61. 'trim' => 0,
  62. 'max_length' => '',
  63. 'word_boundary' => 1,
  64. 'ellipsis' => 1,
  65. 'strip_tags' => 0,
  66. 'html' => 0,
  67. ),
  68. 'empty' => '',
  69. 'hide_empty' => 0,
  70. 'empty_zero' => 0,
  71. 'exclude' => 0,
  72. 'id' => 'ip_address',
  73. 'table' => 'user_stats_ips',
  74. 'field' => 'ip_address',
  75. 'relationship' => 'none',
  76. 'override' => array(
  77. 'button' => 'Override',
  78. ),
  79. ),
  80. 'first_seen_timestamp' => array(
  81. 'label' => 'First seen',
  82. 'alter' => array(
  83. 'alter_text' => 0,
  84. 'text' => '',
  85. 'make_link' => 0,
  86. 'path' => '',
  87. 'alt' => '',
  88. 'prefix' => '',
  89. 'suffix' => '',
  90. 'help' => '',
  91. 'trim' => 0,
  92. 'max_length' => '',
  93. 'word_boundary' => 1,
  94. 'ellipsis' => 1,
  95. 'html' => 0,
  96. ),
  97. 'date_format' => 'small',
  98. 'custom_date_format' => '',
  99. 'exclude' => 0,
  100. 'id' => 'first_seen_timestamp',
  101. 'table' => 'user_stats_ips',
  102. 'field' => 'first_seen_timestamp',
  103. 'relationship' => 'none',
  104. ),
  105. 'ip_user_count' => array(
  106. 'label' => 'Users with IP',
  107. 'alter' => array(
  108. 'alter_text' => 0,
  109. 'text' => '',
  110. 'make_link' => 0,
  111. 'path' => '',
  112. 'alt' => '',
  113. 'prefix' => '',
  114. 'suffix' => '',
  115. 'help' => '',
  116. 'trim' => 0,
  117. 'max_length' => '',
  118. 'word_boundary' => 1,
  119. 'ellipsis' => 1,
  120. 'html' => 0,
  121. ),
  122. 'set_precision' => FALSE,
  123. 'precision' => 0,
  124. 'decimal' => '.',
  125. 'separator' => ',',
  126. 'prefix' => '',
  127. 'suffix' => '',
  128. 'exclude' => 0,
  129. 'id' => 'ip_user_count',
  130. 'table' => 'user_stats_ips',
  131. 'field' => 'ip_user_count',
  132. 'relationship' => 'none',
  133. ),
  134. 'user_ip_count' => array(
  135. 'label' => '',
  136. 'alter' => array(
  137. 'alter_text' => 0,
  138. 'text' => '',
  139. 'make_link' => 0,
  140. 'path' => '',
  141. 'alt' => '',
  142. 'prefix' => '',
  143. 'suffix' => '',
  144. 'help' => '',
  145. 'trim' => 0,
  146. 'max_length' => '',
  147. 'word_boundary' => 0,
  148. 'ellipsis' => 0,
  149. 'html' => 0,
  150. ),
  151. 'set_precision' => FALSE,
  152. 'precision' => 0,
  153. 'decimal' => '.',
  154. 'separator' => '',
  155. 'prefix' => '',
  156. 'suffix' => '',
  157. 'exclude' => 1,
  158. 'id' => 'user_ip_count',
  159. 'table' => 'user_stats_ips',
  160. 'field' => 'user_ip_count',
  161. 'relationship' => 'none',
  162. ),
  163. ));
  164. $handler->override_option('sorts', array(
  165. 'first_seen_timestamp' => array(
  166. 'order' => 'DESC',
  167. 'granularity' => 'second',
  168. 'id' => 'first_seen_timestamp',
  169. 'table' => 'user_stats_ips',
  170. 'field' => 'first_seen_timestamp',
  171. 'relationship' => 'none',
  172. ),
  173. ));
  174. $handler->override_option('arguments', array(
  175. 'name' => array(
  176. 'default_action' => 'ignore',
  177. 'style_plugin' => 'default_summary',
  178. 'style_options' => array(),
  179. 'wildcard' => 'all',
  180. 'wildcard_substitution' => 'All',
  181. 'title' => '',
  182. 'default_argument_type' => 'fixed',
  183. 'default_argument' => '',
  184. 'validate_type' => 'none',
  185. 'validate_fail' => 'not found',
  186. 'glossary' => 0,
  187. 'limit' => '0',
  188. 'case' => 'none',
  189. 'path_case' => 'none',
  190. 'transform_dash' => 0,
  191. 'id' => 'name',
  192. 'table' => 'users',
  193. 'field' => 'name',
  194. 'relationship' => 'none',
  195. 'default_options_div_prefix' => '',
  196. 'default_argument_user' => 0,
  197. 'default_argument_fixed' => '',
  198. 'default_argument_php' => '',
  199. 'validate_argument_node_type' => array(
  200. 'poll' => 0,
  201. 'forum' => 0,
  202. 'page' => 0,
  203. 'project' => 0,
  204. 'story' => 0,
  205. ),
  206. 'validate_argument_node_access' => 0,
  207. 'validate_argument_nid_type' => 'nid',
  208. 'validate_argument_vocabulary' => array(
  209. '1' => 0,
  210. '3' => 0,
  211. '4' => 0,
  212. ),
  213. 'validate_argument_type' => 'tid',
  214. 'validate_argument_php' => '',
  215. ),
  216. ));
  217. $handler->override_option('filters', array(
  218. 'uid' => array(
  219. 'operator' => 'in',
  220. 'value' => '',
  221. 'group' => '0',
  222. 'exposed' => TRUE,
  223. 'expose' => array(
  224. 'use_operator' => 1,
  225. 'operator' => 'uid_op',
  226. 'identifier' => 'uid',
  227. 'label' => 'Username',
  228. 'optional' => 1,
  229. 'remember' => 0,
  230. 'reduce' => 0,
  231. ),
  232. 'id' => 'uid',
  233. 'table' => 'users',
  234. 'field' => 'uid',
  235. 'relationship' => 'none',
  236. ),
  237. 'status' => array(
  238. 'operator' => '=',
  239. 'value' => '1',
  240. 'group' => '0',
  241. 'exposed' => TRUE,
  242. 'expose' => array(
  243. 'operator' => '',
  244. 'identifier' => 'status',
  245. 'label' => 'User is active',
  246. 'optional' => 1,
  247. 'remember' => 1,
  248. ),
  249. 'id' => 'status',
  250. 'table' => 'users',
  251. 'field' => 'status',
  252. 'relationship' => 'none',
  253. ),
  254. ));
  255. $handler->override_option('access', array(
  256. 'type' => 'perm',
  257. 'perm' => 'View IP addresses',
  258. ));
  259. $handler->override_option('cache', array(
  260. 'type' => 'none',
  261. ));
  262. $handler->override_option('title', 'IP address history by user');
  263. $handler->override_option('empty', 'No IP addresses found.');
  264. $handler->override_option('empty_format', '1');
  265. $handler->override_option('items_per_page', 100);
  266. $handler->override_option('use_pager', '1');
  267. $handler->override_option('distinct', 1);
  268. $handler->override_option('style_plugin', 'table');
  269. $handler->override_option('style_options', array(
  270. 'grouping' => 'name',
  271. 'override' => 1,
  272. 'sticky' => 0,
  273. 'order' => 'desc',
  274. 'columns' => array(
  275. 'name' => 'name',
  276. 'first_seen_timestamp' => 'first_seen_timestamp',
  277. 'ip_address' => 'ip_address',
  278. 'ip_user_count' => 'ip_user_count',
  279. 'user_ip_count' => 'user_ip_count',
  280. ),
  281. 'info' => array(
  282. 'name' => array(
  283. 'sortable' => 1,
  284. 'separator' => '',
  285. ),
  286. 'first_seen_timestamp' => array(
  287. 'sortable' => 1,
  288. 'separator' => '',
  289. ),
  290. 'ip_address' => array(
  291. 'separator' => '',
  292. ),
  293. 'ip_user_count' => array(
  294. 'sortable' => 1,
  295. 'separator' => '',
  296. ),
  297. 'user_ip_count' => array(
  298. 'sortable' => 0,
  299. 'separator' => '',
  300. ),
  301. ),
  302. 'default' => 'user_ip_count',
  303. ));
  304. $handler = $view->new_display('page', 'Page', 'page_1');
  305. $handler->override_option('path', 'admin/reports/ip_tracking/by_user');
  306. $handler->override_option('menu', array(
  307. 'type' => 'tab',
  308. 'title' => 'IPs by user',
  309. 'description' => 'Lookup users and view a history of their IP addresses.',
  310. 'weight' => '0',
  311. 'name' => 'navigation',
  312. ));
  313. $handler->override_option('tab_options', array(
  314. 'type' => 'tab',
  315. 'title' => '',
  316. 'description' => '',
  317. 'weight' => '0',
  318. ));
  319. $handler = $view->new_display('page', 'Lookup page', 'page_2');
  320. $handler->override_option('path', 'admin/reports/ip_tracking/by_user/%');
  321. $handler->override_option('menu', array(
  322. 'type' => 'none',
  323. 'title' => '',
  324. 'description' => '',
  325. 'weight' => 0,
  326. 'name' => 'navigation',
  327. ));
  328. $handler->override_option('tab_options', array(
  329. 'type' => 'none',
  330. 'title' => '',
  331. 'description' => '',
  332. 'weight' => 0,
  333. ));
  334. $handler = $view->new_display('page', 'User profile tab', 'page_3');
  335. $handler->override_option('fields', array(
  336. 'ip_address' => array(
  337. 'label' => 'IP',
  338. 'alter' => array(
  339. 'alter_text' => 0,
  340. 'text' => '',
  341. 'make_link' => 1,
  342. 'path' => 'admin/reports/ip_tracking/by_ip/[ip_address]',
  343. 'link_class' => '',
  344. 'alt' => 'View other users with this IP address',
  345. 'prefix' => '',
  346. 'suffix' => '',
  347. 'target' => '',
  348. 'help' => '',
  349. 'trim' => 0,
  350. 'max_length' => '',
  351. 'word_boundary' => 1,
  352. 'ellipsis' => 1,
  353. 'strip_tags' => 0,
  354. 'html' => 0,
  355. ),
  356. 'empty' => '',
  357. 'hide_empty' => 0,
  358. 'empty_zero' => 0,
  359. 'exclude' => 0,
  360. 'id' => 'ip_address',
  361. 'table' => 'user_stats_ips',
  362. 'field' => 'ip_address',
  363. 'relationship' => 'none',
  364. 'override' => array(
  365. 'button' => 'Override',
  366. ),
  367. ),
  368. 'first_seen_timestamp' => array(
  369. 'label' => 'First seen',
  370. 'alter' => array(
  371. 'alter_text' => 0,
  372. 'text' => '',
  373. 'make_link' => 0,
  374. 'path' => '',
  375. 'alt' => '',
  376. 'prefix' => '',
  377. 'suffix' => '',
  378. 'help' => '',
  379. 'trim' => 0,
  380. 'max_length' => '',
  381. 'word_boundary' => 1,
  382. 'ellipsis' => 1,
  383. 'html' => 0,
  384. ),
  385. 'date_format' => 'small',
  386. 'custom_date_format' => '',
  387. 'exclude' => 0,
  388. 'id' => 'first_seen_timestamp',
  389. 'table' => 'user_stats_ips',
  390. 'field' => 'first_seen_timestamp',
  391. 'relationship' => 'none',
  392. ),
  393. 'ip_user_count' => array(
  394. 'label' => 'Users with IP',
  395. 'alter' => array(
  396. 'alter_text' => 0,
  397. 'text' => '',
  398. 'make_link' => 0,
  399. 'path' => '',
  400. 'alt' => '',
  401. 'prefix' => '',
  402. 'suffix' => '',
  403. 'help' => '',
  404. 'trim' => 0,
  405. 'max_length' => '',
  406. 'word_boundary' => 1,
  407. 'ellipsis' => 1,
  408. 'html' => 0,
  409. ),
  410. 'set_precision' => FALSE,
  411. 'precision' => 0,
  412. 'decimal' => '.',
  413. 'separator' => ',',
  414. 'prefix' => '',
  415. 'suffix' => '',
  416. 'exclude' => 0,
  417. 'id' => 'ip_user_count',
  418. 'table' => 'user_stats_ips',
  419. 'field' => 'ip_user_count',
  420. 'relationship' => 'none',
  421. ),
  422. 'user_ip_count' => array(
  423. 'label' => '',
  424. 'alter' => array(
  425. 'alter_text' => 0,
  426. 'text' => '',
  427. 'make_link' => 0,
  428. 'path' => '',
  429. 'alt' => '',
  430. 'prefix' => '',
  431. 'suffix' => '',
  432. 'help' => '',
  433. 'trim' => 0,
  434. 'max_length' => '',
  435. 'word_boundary' => 0,
  436. 'ellipsis' => 0,
  437. 'html' => 0,
  438. ),
  439. 'set_precision' => FALSE,
  440. 'precision' => 0,
  441. 'decimal' => '.',
  442. 'separator' => '',
  443. 'prefix' => '',
  444. 'suffix' => '',
  445. 'exclude' => 1,
  446. 'id' => 'user_ip_count',
  447. 'table' => 'user_stats_ips',
  448. 'field' => 'user_ip_count',
  449. 'relationship' => 'none',
  450. ),
  451. ));
  452. $handler->override_option('arguments', array(
  453. 'uid' => array(
  454. 'default_action' => 'empty',
  455. 'style_plugin' => 'default_summary',
  456. 'style_options' => array(),
  457. 'wildcard' => 'all',
  458. 'wildcard_substitution' => 'All',
  459. 'title' => '',
  460. 'breadcrumb' => '',
  461. 'default_argument_type' => 'fixed',
  462. 'default_argument' => '',
  463. 'validate_type' => 'none',
  464. 'validate_fail' => 'not found',
  465. 'break_phrase' => 0,
  466. 'not' => 0,
  467. 'id' => 'uid',
  468. 'table' => 'users',
  469. 'field' => 'uid',
  470. 'validate_user_argument_type' => 'uid',
  471. 'validate_user_roles' => array(
  472. '2' => 0,
  473. '1000006' => 0,
  474. '1000047' => 0,
  475. '1000054' => 0,
  476. '1000059' => 0,
  477. '1000048' => 0,
  478. '1000002' => 0,
  479. '1000058' => 0,
  480. '1000056' => 0,
  481. '1000057' => 0,
  482. '1000046' => 0,
  483. '1000055' => 0,
  484. '1000051' => 0,
  485. '1000053' => 0,
  486. '1000003' => 0,
  487. ),
  488. 'override' => array(
  489. 'button' => 'Use default',
  490. ),
  491. 'relationship' => 'none',
  492. 'default_options_div_prefix' => '',
  493. 'default_argument_user' => 0,
  494. 'default_argument_fixed' => '',
  495. 'default_argument_php' => '',
  496. 'validate_argument_node_type' => array(
  497. 'poll' => 0,
  498. 'ad' => 0,
  499. 'forum' => 0,
  500. 'book' => 0,
  501. 'page' => 0,
  502. 'project' => 0,
  503. 'story' => 0,
  504. ),
  505. 'validate_argument_node_access' => 0,
  506. 'validate_argument_nid_type' => 'nid',
  507. 'validate_argument_vocabulary' => array(
  508. '1' => 0,
  509. '6' => 0,
  510. '3' => 0,
  511. '4' => 0,
  512. ),
  513. 'validate_argument_type' => 'tid',
  514. 'validate_argument_transform' => 0,
  515. 'validate_user_restrict_roles' => 0,
  516. 'validate_argument_node_flag_name' => '*relationship*',
  517. 'validate_argument_node_flag_test' => 'flaggable',
  518. 'validate_argument_node_flag_id_type' => 'id',
  519. 'validate_argument_user_flag_name' => '*relationship*',
  520. 'validate_argument_user_flag_test' => 'flaggable',
  521. 'validate_argument_user_flag_id_type' => 'id',
  522. 'validate_argument_php' => '',
  523. ),
  524. ));
  525. $handler->override_option('filters', array());
  526. $handler->override_option('path', 'user/%/ip_tracking');
  527. $handler->override_option('menu', array(
  528. 'type' => 'tab',
  529. 'title' => 'IP addresses',
  530. 'description' => '',
  531. 'weight' => '0',
  532. 'name' => 'navigation',
  533. ));
  534. $handler->override_option('tab_options', array(
  535. 'type' => 'none',
  536. 'title' => '',
  537. 'description' => '',
  538. 'weight' => '0',
  539. ));
  540. $views[$view->name] = $view;
  541. /*
  542. * View 'user_stats_online_users'
  543. */
  544. $view = new view;
  545. $view->name = 'user_stats_online_users';
  546. $view->description = 'A list of online users.';
  547. $view->tag = '';
  548. $view->view_php = '';
  549. $view->base_table = 'users';
  550. $view->is_cacheable = FALSE;
  551. $view->api_version = 2;
  552. $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
  553. $handler = $view->new_display('default', 'Defaults', 'default');
  554. $handler->override_option('fields', array(
  555. 'name' => array(
  556. 'label' => '',
  557. 'alter' => array(
  558. 'alter_text' => 0,
  559. 'text' => '',
  560. 'make_link' => 0,
  561. 'path' => '',
  562. 'alt' => '',
  563. 'prefix' => '',
  564. 'suffix' => '',
  565. 'help' => '',
  566. 'trim' => 0,
  567. 'max_length' => '',
  568. 'word_boundary' => 1,
  569. 'ellipsis' => 1,
  570. 'html' => 0,
  571. ),
  572. 'link_to_user' => 1,
  573. 'overwrite_anonymous' => 0,
  574. 'anonymous_text' => '',
  575. 'exclude' => 0,
  576. 'id' => 'name',
  577. 'table' => 'users',
  578. 'field' => 'name',
  579. 'relationship' => 'none',
  580. ),
  581. ));
  582. $handler->override_option('filters', array(
  583. 'is_online' => array(
  584. 'operator' => '=',
  585. 'value' => '1',
  586. 'group' => '0',
  587. 'exposed' => FALSE,
  588. 'expose' => array(
  589. 'operator' => FALSE,
  590. 'label' => '',
  591. ),
  592. 'id' => 'is_online',
  593. 'table' => 'users',
  594. 'field' => 'is_online',
  595. 'relationship' => 'none',
  596. ),
  597. ));
  598. $handler->override_option('access', array(
  599. 'type' => 'perm',
  600. 'perm' => 'View statistics',
  601. ));
  602. $handler->override_option('cache', array(
  603. 'type' => 'none',
  604. ));
  605. $handler->override_option('title', 'Online users');
  606. $handler->override_option('use_ajax', TRUE);
  607. $handler->override_option('use_pager', 'mini');
  608. $handler->override_option('style_options', array(
  609. 'grouping' => '',
  610. ));
  611. $handler = $view->new_display('block', 'Block', 'block_1');
  612. $handler->override_option('block_description', 'Online users');
  613. $handler->override_option('block_caching', -1);
  614. $views[$view->name] = $view;
  615. /*
  616. * View 'user_stats_online_users_pictures'
  617. */
  618. $view = new view;
  619. $view->name = 'user_stats_online_users_pictures';
  620. $view->description = 'Shows who is online by displaying their user pictures (avatars).';
  621. $view->tag = '';
  622. $view->view_php = '';
  623. $view->base_table = 'users';
  624. $view->is_cacheable = FALSE;
  625. $view->api_version = 2;
  626. $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
  627. $handler = $view->new_display('default', 'Defaults', 'default');
  628. $handler->override_option('fields', array(
  629. 'uid' => array(
  630. 'label' => 'Uid',
  631. 'alter' => array(
  632. 'alter_text' => 0,
  633. 'text' => '',
  634. 'make_link' => 0,
  635. 'path' => '',
  636. 'alt' => '',
  637. 'prefix' => '',
  638. 'suffix' => '',
  639. 'help' => '',
  640. 'trim' => 0,
  641. 'max_length' => '',
  642. 'word_boundary' => 1,
  643. 'ellipsis' => 1,
  644. 'html' => 0,
  645. ),
  646. 'link_to_user' => 0,
  647. 'exclude' => 1,
  648. 'id' => 'uid',
  649. 'table' => 'users',
  650. 'field' => 'uid',
  651. 'relationship' => 'none',
  652. ),
  653. 'picture_bare' => array(
  654. 'label' => '',
  655. 'alter' => array(
  656. 'alter_text' => 0,
  657. 'text' => '',
  658. 'make_link' => 1,
  659. 'path' => 'user/[uid]',
  660. 'alt' => '',
  661. 'prefix' => '',
  662. 'suffix' => '',
  663. 'help' => '',
  664. 'trim' => 0,
  665. 'max_length' => '',
  666. 'word_boundary' => 1,
  667. 'ellipsis' => 1,
  668. 'html' => 0,
  669. ),
  670. 'exclude' => 0,
  671. 'id' => 'picture_bare',
  672. 'table' => 'users',
  673. 'field' => 'picture_bare',
  674. 'relationship' => 'none',
  675. ),
  676. ));
  677. $handler->override_option('filters', array(
  678. 'is_online' => array(
  679. 'operator' => '=',
  680. 'value' => '1',
  681. 'group' => '0',
  682. 'exposed' => FALSE,
  683. 'expose' => array(
  684. 'operator' => FALSE,
  685. 'label' => '',
  686. ),
  687. 'id' => 'is_online',
  688. 'table' => 'users',
  689. 'field' => 'is_online',
  690. 'relationship' => 'none',
  691. ),
  692. ));
  693. $handler->override_option('access', array(
  694. 'type' => 'perm',
  695. 'perm' => 'View statistics',
  696. ));
  697. $handler->override_option('cache', array(
  698. 'type' => 'none',
  699. ));
  700. $handler->override_option('title', 'Online users');
  701. $handler->override_option('use_ajax', TRUE);
  702. $handler->override_option('use_pager', 'mini');
  703. $handler->override_option('style_options', array(
  704. 'grouping' => '',
  705. ));
  706. $handler = $view->new_display('block', 'Block', 'block_1');
  707. $handler->override_option('block_description', 'Online users (pictures)');
  708. $handler->override_option('block_caching', -1);
  709. $views[$view->name] = $view;
  710. /*
  711. * View 'user_stats_top_posters'
  712. */
  713. $view = new view;
  714. $view->name = 'user_stats_top_posters';
  715. $view->description = 'Provides a block and page showing users with the highest post counts.';
  716. $view->tag = '';
  717. $view->view_php = '';
  718. $view->base_table = 'users';
  719. $view->is_cacheable = FALSE;
  720. $view->api_version = 2;
  721. $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
  722. $handler = $view->new_display('default', 'Defaults', 'default');
  723. $handler->override_option('fields', array(
  724. 'name' => array(
  725. 'label' => 'Name',
  726. 'alter' => array(
  727. 'alter_text' => 0,
  728. 'text' => '',
  729. 'make_link' => 0,
  730. 'path' => '',
  731. 'alt' => '',
  732. 'prefix' => '',
  733. 'suffix' => '',
  734. 'help' => '',
  735. 'trim' => 0,
  736. 'max_length' => '',
  737. 'word_boundary' => 1,
  738. 'ellipsis' => 1,
  739. 'html' => 0,
  740. ),
  741. 'link_to_user' => 1,
  742. 'exclude' => 0,
  743. 'id' => 'name',
  744. 'table' => 'users',
  745. 'field' => 'name',
  746. 'relationship' => 'none',
  747. ),
  748. 'value' => array(
  749. 'label' => 'Posts',
  750. 'alter' => array(
  751. 'alter_text' => 0,
  752. 'text' => '',
  753. 'make_link' => 0,
  754. 'path' => '',
  755. 'alt' => '',
  756. 'prefix' => '',
  757. 'suffix' => '',
  758. 'help' => '',
  759. 'trim' => 0,
  760. 'max_length' => '',
  761. 'word_boundary' => 1,
  762. 'ellipsis' => 1,
  763. 'html' => 0,
  764. ),
  765. 'set_precision' => FALSE,
  766. 'precision' => 0,
  767. 'decimal' => '.',
  768. 'separator' => ',',
  769. 'prefix' => '',
  770. 'suffix' => '',
  771. 'exclude' => 0,
  772. 'id' => 'value',
  773. 'table' => 'user_stats_values',
  774. 'field' => 'value',
  775. 'relationship' => 'none',
  776. ),
  777. ));
  778. $handler->override_option('sorts', array(
  779. 'value' => array(
  780. 'order' => 'DESC',
  781. 'id' => 'value',
  782. 'table' => 'user_stats_values',
  783. 'field' => 'value',
  784. 'relationship' => 'none',
  785. ),
  786. ));
  787. $handler->override_option('filters', array(
  788. 'name' => array(
  789. 'operator' => '=',
  790. 'value' => 'post_count',
  791. 'group' => '0',
  792. 'exposed' => FALSE,
  793. 'expose' => array(
  794. 'operator' => FALSE,
  795. 'label' => '',
  796. ),
  797. 'case' => 1,
  798. 'id' => 'name',
  799. 'table' => 'user_stats_values',
  800. 'field' => 'name',
  801. 'relationship' => 'none',
  802. ),
  803. 'status' => array(
  804. 'operator' => '=',
  805. 'value' => '1',
  806. 'group' => '0',
  807. 'exposed' => FALSE,
  808. 'expose' => array(
  809. 'operator' => FALSE,
  810. 'label' => '',
  811. ),
  812. 'id' => 'status',
  813. 'table' => 'users',
  814. 'field' => 'status',
  815. 'relationship' => 'none',
  816. ),
  817. ));
  818. $handler->override_option('access', array(
  819. 'type' => 'perm',
  820. 'perm' => 'View statistics',
  821. ));
  822. $handler->override_option('cache', array(
  823. 'type' => 'none',
  824. ));
  825. $handler->override_option('title', 'Top posters');
  826. $handler->override_option('items_per_page', 20);
  827. $handler->override_option('use_pager', '1');
  828. $handler->override_option('use_more', 0);
  829. $handler->override_option('style_plugin', 'table');
  830. $handler->override_option('style_options', array(
  831. 'grouping' => '',
  832. 'override' => 1,
  833. 'sticky' => 0,
  834. 'order' => 'asc',
  835. 'columns' => array(
  836. 'name' => 'name',
  837. 'value' => 'value',
  838. ),
  839. 'info' => array(
  840. 'name' => array(
  841. 'sortable' => 0,
  842. 'separator' => '',
  843. ),
  844. 'value' => array(
  845. 'sortable' => 0,
  846. 'separator' => '',
  847. ),
  848. ),
  849. 'default' => '-1',
  850. ));
  851. $handler = $view->new_display('block', 'Block', 'block_1');
  852. $handler->override_option('use_ajax', TRUE);
  853. $handler->override_option('items_per_page', 10);
  854. $handler->override_option('use_pager', 'mini');
  855. $handler->override_option('use_more', 1);
  856. $handler->override_option('block_description', 'Top 10 posters');
  857. $handler->override_option('block_caching', -1);
  858. $handler = $view->new_display('page', 'Page', 'page_1');
  859. $handler->override_option('path', 'top-posters');
  860. $handler->override_option('menu', array(
  861. 'type' => 'normal',
  862. 'title' => 'Top posters',
  863. 'description' => 'Site users ordered by post count',
  864. 'weight' => '0',
  865. 'name' => 'navigation',
  866. ));
  867. $handler->override_option('tab_options', array(
  868. 'type' => 'none',
  869. 'title' => '',
  870. 'description' => '',
  871. 'weight' => 0,
  872. ));
  873. $views[$view->name] = $view;
  874. /*
  875. * View 'user_stats_users_by_ip'
  876. */
  877. $view = new view;
  878. $view->name = 'user_stats_users_by_ip';
  879. $view->description = 'Users grouped by IP address. Shows IP addresses in use by multiple users. This views works in conjunction with user_stats_ips_by_user and will not work correctly unless it is also enabled.';
  880. $view->tag = '';
  881. $view->view_php = '';
  882. $view->base_table = 'users';
  883. $view->is_cacheable = FALSE;
  884. $view->api_version = 2;
  885. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  886. $handler = $view->new_display('default', 'Defaults', 'default');
  887. $handler->override_option('fields', array(
  888. 'ip_address' => array(
  889. 'label' => 'IP',
  890. 'alter' => array(
  891. 'alter_text' => 1,
  892. 'text' => '<strong>[ip_address]</strong>',
  893. 'make_link' => 0,
  894. 'path' => '',
  895. 'alt' => '',
  896. 'prefix' => '',
  897. 'suffix' => '',
  898. 'help' => '',
  899. 'trim' => 0,
  900. 'max_length' => '',
  901. 'word_boundary' => 1,
  902. 'ellipsis' => 1,
  903. 'html' => 0,
  904. ),
  905. 'exclude' => 1,
  906. 'id' => 'ip_address',
  907. 'table' => 'user_stats_ips',
  908. 'field' => 'ip_address',
  909. 'relationship' => 'none',
  910. 'override' => array(
  911. 'button' => 'Override',
  912. ),
  913. ),
  914. 'name' => array(
  915. 'label' => 'Name',
  916. 'alter' => array(
  917. 'alter_text' => 0,
  918. 'text' => '',
  919. 'make_link' => 1,
  920. 'path' => 'admin/reports/ip_tracking/by_user/[name]',
  921. 'link_class' => '',
  922. 'alt' => 'View other IP addresses used by this user',
  923. 'prefix' => '',
  924. 'suffix' => '',
  925. 'target' => '',
  926. 'help' => '',
  927. 'trim' => 0,
  928. 'max_length' => '',
  929. 'word_boundary' => 1,
  930. 'ellipsis' => 1,
  931. 'strip_tags' => 0,
  932. 'html' => 0,
  933. ),
  934. 'empty' => '',
  935. 'hide_empty' => 0,
  936. 'empty_zero' => 0,
  937. 'link_to_user' => 0,
  938. 'overwrite_anonymous' => 0,
  939. 'anonymous_text' => '',
  940. 'exclude' => 0,
  941. 'id' => 'name',
  942. 'table' => 'users',
  943. 'field' => 'name',
  944. 'relationship' => 'none',
  945. 'override' => array(
  946. 'button' => 'Override',
  947. ),
  948. ),
  949. 'ip_user_count' => array(
  950. 'label' => 'Users with IP',
  951. 'alter' => array(
  952. 'alter_text' => 0,
  953. 'text' => '',
  954. 'make_link' => 0,
  955. 'path' => '',
  956. 'alt' => '',
  957. 'prefix' => '',
  958. 'suffix' => '',
  959. 'help' => '',
  960. 'trim' => 0,
  961. 'max_length' => '',
  962. 'word_boundary' => 1,
  963. 'ellipsis' => 1,
  964. 'html' => 0,
  965. ),
  966. 'set_precision' => FALSE,
  967. 'precision' => 0,
  968. 'decimal' => '.',
  969. 'separator' => ',',
  970. 'prefix' => '',
  971. 'suffix' => '',
  972. 'exclude' => 1,
  973. 'id' => 'ip_user_count',
  974. 'table' => 'user_stats_ips',
  975. 'field' => 'ip_user_count',
  976. 'relationship' => 'none',
  977. ),
  978. 'created' => array(
  979. 'label' => 'Created date',
  980. 'alter' => array(
  981. 'alter_text' => 0,
  982. 'text' => '',
  983. 'make_link' => 0,
  984. 'path' => '',
  985. 'link_class' => '',
  986. 'alt' => '',
  987. 'prefix' => '',
  988. 'suffix' => '',
  989. 'target' => '',
  990. 'help' => '',
  991. 'trim' => 0,
  992. 'max_length' => '',
  993. 'word_boundary' => 1,
  994. 'ellipsis' => 1,
  995. 'strip_tags' => 0,
  996. 'html' => 0,
  997. ),
  998. 'empty' => '',
  999. 'hide_empty' => 0,
  1000. 'empty_zero' => 0,
  1001. 'date_format' => 'small',
  1002. 'custom_date_format' => '',
  1003. 'exclude' => 0,
  1004. 'id' => 'created',
  1005. 'table' => 'users',
  1006. 'field' => 'created',
  1007. 'relationship' => 'none',
  1008. ),
  1009. 'access' => array(
  1010. 'label' => 'Last access',
  1011. 'alter' => array(
  1012. 'alter_text' => 0,
  1013. 'text' => '',
  1014. 'make_link' => 0,
  1015. 'path' => '',
  1016. 'link_class' => '',
  1017. 'alt' => '',
  1018. 'prefix' => '',
  1019. 'suffix' => '',
  1020. 'target' => '',
  1021. 'help' => '',
  1022. 'trim' => 0,
  1023. 'max_length' => '',
  1024. 'word_boundary' => 1,
  1025. 'ellipsis' => 1,
  1026. 'strip_tags' => 0,
  1027. 'html' => 0,
  1028. ),
  1029. 'empty' => '',
  1030. 'hide_empty' => 0,
  1031. 'empty_zero' => 0,
  1032. 'date_format' => 'raw time ago',
  1033. 'custom_date_format' => '',
  1034. 'exclude' => 0,
  1035. 'id' => 'access',
  1036. 'table' => 'users',
  1037. 'field' => 'access',
  1038. 'relationship' => 'none',
  1039. ),
  1040. 'status' => array(
  1041. 'label' => 'Active',
  1042. 'alter' => array(
  1043. 'alter_text' => 0,
  1044. 'text' => '',
  1045. 'make_link' => 0,
  1046. 'path' => '',
  1047. 'link_class' => '',
  1048. 'alt' => '',
  1049. 'prefix' => '',
  1050. 'suffix' => '',
  1051. 'target' => '',
  1052. 'help' => '',
  1053. 'trim' => 0,
  1054. 'max_length' => '',
  1055. 'word_boundary' => 1,
  1056. 'ellipsis' => 1,
  1057. 'strip_tags' => 0,
  1058. 'html' => 0,
  1059. ),
  1060. 'empty' => '',
  1061. 'hide_empty' => 0,
  1062. 'empty_zero' => 0,
  1063. 'type' => 'yes-no',
  1064. 'not' => 0,
  1065. 'exclude' => 0,
  1066. 'id' => 'status',
  1067. 'table' => 'users',
  1068. 'field' => 'status',
  1069. 'relationship' => 'none',
  1070. ),
  1071. 'edit_node' => array(
  1072. 'label' => '',
  1073. 'alter' => array(
  1074. 'alter_text' => 0,
  1075. 'text' => '',
  1076. 'make_link' => 0,
  1077. 'path' => '',
  1078. 'link_class' => '',
  1079. 'alt' => '',
  1080. 'prefix' => '',
  1081. 'suffix' => '',
  1082. 'target' => '',
  1083. 'help' => '',
  1084. 'trim' => 0,
  1085. 'max_length' => '',
  1086. 'word_boundary' => 1,
  1087. 'ellipsis' => 1,
  1088. 'strip_tags' => 0,
  1089. 'html' => 0,
  1090. ),
  1091. 'empty' => '',
  1092. 'hide_empty' => 0,
  1093. 'empty_zero' => 0,
  1094. 'text' => 'edit user',
  1095. 'exclude' => 0,
  1096. 'id' => 'edit_node',
  1097. 'table' => 'users',
  1098. 'field' => 'edit_node',
  1099. 'relationship' => 'none',
  1100. ),
  1101. ));
  1102. $handler->override_option('arguments', array(
  1103. 'ip_address' => array(
  1104. 'default_action' => 'ignore',
  1105. 'style_plugin' => 'default_summary',
  1106. 'style_options' => array(),
  1107. 'wildcard' => 'all',
  1108. 'wildcard_substitution' => 'All',
  1109. 'title' => 'Searching for: %1',
  1110. 'default_argument_type' => 'fixed',
  1111. 'default_argument' => '',
  1112. 'validate_type' => 'none',
  1113. 'validate_fail' => 'not found',
  1114. 'glossary' => 0,
  1115. 'limit' => '0',
  1116. 'case' => 'none',
  1117. 'path_case' => 'none',
  1118. 'transform_dash' => 0,
  1119. 'id' => 'ip_address',
  1120. 'table' => 'user_stats_ips',
  1121. 'field' => 'ip_address',
  1122. 'relationship' => 'none',
  1123. 'default_options_div_prefix' => '',
  1124. 'default_argument_user' => 0,
  1125. 'default_argument_fixed' => '',
  1126. 'default_argument_php' => '',
  1127. 'validate_argument_node_type' => array(
  1128. 'poll' => 0,
  1129. 'forum' => 0,
  1130. 'page' => 0,
  1131. 'project' => 0,
  1132. 'story' => 0,
  1133. ),
  1134. 'validate_argument_node_access' => 0,
  1135. 'validate_argument_nid_type' => 'nid',
  1136. 'validate_argument_vocabulary' => array(
  1137. '1' => 0,
  1138. '3' => 0,
  1139. '4' => 0,
  1140. ),
  1141. 'validate_argument_type' => 'tid',
  1142. 'validate_argument_php' => '',
  1143. ),
  1144. ));
  1145. $handler->override_option('filters', array(
  1146. 'ip_address' => array(
  1147. 'operator' => '!=',
  1148. 'value' => '',
  1149. 'group' => '0',
  1150. 'exposed' => FALSE,
  1151. 'expose' => array(
  1152. 'operator' => FALSE,
  1153. 'label' => '',
  1154. ),
  1155. 'case' => 1,
  1156. 'id' => 'ip_address',
  1157. 'table' => 'user_stats_ips',
  1158. 'field' => 'ip_address',
  1159. 'relationship' => 'none',
  1160. ),
  1161. 'ip_address_1' => array(
  1162. 'operator' => 'starts',
  1163. 'value' => '',
  1164. 'group' => '0',
  1165. 'exposed' => TRUE,
  1166. 'expose' => array(
  1167. 'use_operator' => 1,
  1168. 'operator' => 'ip_address_1_op',
  1169. 'identifier' => 'ip_address_1',
  1170. 'label' => 'IP address',
  1171. 'optional' => 1,
  1172. 'remember' => 0,
  1173. ),
  1174. 'case' => 1,
  1175. 'id' => 'ip_address_1',
  1176. 'table' => 'user_stats_ips',
  1177. 'field' => 'ip_address',
  1178. 'relationship' => 'none',
  1179. ),
  1180. 'status' => array(
  1181. 'operator' => '=',
  1182. 'value' => '1',
  1183. 'group' => '0',
  1184. 'exposed' => TRUE,
  1185. 'expose' => array(
  1186. 'operator' => '',
  1187. 'identifier' => 'status',
  1188. 'label' => 'User is active',
  1189. 'optional' => 1,
  1190. 'remember' => 1,
  1191. ),
  1192. 'id' => 'status',
  1193. 'table' => 'users',
  1194. 'field' => 'status',
  1195. 'relationship' => 'none',
  1196. ),
  1197. ));
  1198. $handler->override_option('access', array(
  1199. 'type' => 'perm',
  1200. 'perm' => 'View IP addresses',
  1201. ));
  1202. $handler->override_option('cache', array(
  1203. 'type' => 'none',
  1204. ));
  1205. $handler->override_option('title', 'Users by IP address');
  1206. $handler->override_option('empty', 'No IP address recorded.');
  1207. $handler->override_option('empty_format', '1');
  1208. $handler->override_option('items_per_page', 100);
  1209. $handler->override_option('use_pager', '1');
  1210. $handler->override_option('distinct', 1);
  1211. $handler->override_option('style_plugin', 'table');
  1212. $handler->override_option('style_options', array(
  1213. 'grouping' => 'ip_address',
  1214. 'override' => 1,
  1215. 'sticky' => 0,
  1216. 'order' => 'desc',
  1217. 'columns' => array(
  1218. 'ip_address' => 'ip_address',
  1219. 'name' => 'name',
  1220. 'ip_user_count' => 'ip_user_count',
  1221. ),
  1222. 'info' => array(
  1223. 'ip_address' => array(
  1224. 'separator' => '',
  1225. ),
  1226. 'name' => array(
  1227. 'sortable' => 0,
  1228. 'separator' => '',
  1229. ),
  1230. 'ip_user_count' => array(
  1231. 'sortable' => 1,
  1232. 'separator' => '',
  1233. ),
  1234. ),
  1235. 'default' => 'ip_user_count',
  1236. ));
  1237. $handler = $view->new_display('page', 'Page', 'page_1');
  1238. $handler->override_option('path', 'admin/reports/ip_tracking/by_ip');
  1239. $handler->override_option('menu', array(
  1240. 'type' => 'default tab',
  1241. 'title' => 'Users by IP',
  1242. 'description' => 'Lookup IPs and view which users share IP addresses.',
  1243. 'weight' => '-2',
  1244. 'name' => 'navigation',
  1245. ));
  1246. $handler->override_option('tab_options', array(
  1247. 'type' => 'normal',
  1248. 'title' => 'IP address tracking',
  1249. 'description' => 'View IP addresses and the users associated with them.',
  1250. 'weight' => '0',
  1251. ));
  1252. $handler = $view->new_display('page', 'Lookup page', 'page_2');
  1253. $handler->override_option('path', 'admin/reports/ip_tracking/by_ip/%');
  1254. $handler->override_option('menu', array(
  1255. 'type' => 'none',
  1256. 'title' => '',
  1257. 'description' => '',
  1258. 'weight' => 0,
  1259. 'name' => 'navigation',
  1260. ));
  1261. $handler->override_option('tab_options', array(
  1262. 'type' => 'none',
  1263. 'title' => '',
  1264. 'description' => '',
  1265. 'weight' => 0,
  1266. ));
  1267. $views[$view->name] = $view;
  1268. return $views;
  1269. }