Projet

Général

Profil

Paste
Télécharger (485 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / user_stats / user_stats.api.php @ 87dbc3bf

1
<?php
2

    
3
/**
4
 * Aggregates list of all custom user statistics
5
 */
6
function hook_default_user_stats() {
7
  return array(
8
    'custom_count_1' => 'custom_count_1_callback',
9
    'custom_count_2' => 'custom_count_2_callback',
10
  );
11
}
12

    
13
function custom_count_1_callback($uid = NULL) {
14
  global $user;
15

    
16
  if ($uid == NULL) {
17
    $uid = $user->uid;
18
  }
19

    
20
  return 1;
21
}
22

    
23
function custom_count_2_callback($uid = NULL) {
24
  global $user;
25

    
26
  if ($uid == NULL) {
27
    $uid = $user->uid;
28
  }
29

    
30
  return 2;
31
}