You are here

function user_list_activity_actions in Activity 6.2

List all the Activity Actions that match the hook and op.

Parameters

string $hook: The hook that is to be fired.

string $op: The op to be used in the hook.

int $max_age: The max age from right now to list activities.

Return value

array An array of arrays with 'id', 'created' and 'actor' keys.

1 string reference to 'user_list_activity_actions'
user_activity_info in ./activity.module

File

modules/user.activity.inc, line 58
Activity definition file for user.module

Code

function user_list_activity_actions($hook, $op, $max_age) {
  $actions = array();
  if (!empty($max_age)) {
    $min_time = time() - $max_age;
  }
  else {
    $min_time = 0;
  }
  if ($op == 'insert') {
    $sql = "SELECT uid as id, created as created, uid as actor FROM {users} WHERE uid <> 0 AND created > %d";
  }
  if (isset($sql)) {
    $result = db_query($sql, $min_time);
    while ($row = db_fetch_array($result)) {
      $actions[] = $row;
    }
  }
  return $actions;
}