user_stats.api.php 485 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Aggregates list of all custom user statistics
  4. */
  5. function hook_default_user_stats() {
  6. return array(
  7. 'custom_count_1' => 'custom_count_1_callback',
  8. 'custom_count_2' => 'custom_count_2_callback',
  9. );
  10. }
  11. function custom_count_1_callback($uid = NULL) {
  12. global $user;
  13. if ($uid == NULL) {
  14. $uid = $user->uid;
  15. }
  16. return 1;
  17. }
  18. function custom_count_2_callback($uid = NULL) {
  19. global $user;
  20. if ($uid == NULL) {
  21. $uid = $user->uid;
  22. }
  23. return 2;
  24. }