You are here

function activity_votingapi_insert in Activity 5

Implementation of hook_votingapi_insert()

File

includes/votingapi.inc, line 30

Code

function activity_votingapi_insert() {
  global $user;
  $args = func_get_args();
  $node = node_load($args[0]->content_id);

  // it's safe to set this to 'mark' since we're only implementing hook_votingapi_insert()
  $action = 'mark';
  $type = 1;
  $token = array(
    'user-id' => $user->uid,
    'user-name' => $user->name,
    'node-id' => $args[0]->content_id,
    'node-title' => $node->title,
    'rating-value' => $args[0]->value,
    'rating_type' => $args[0]->value_type,
  );
  activity_insert('votingapi', $type, $action, $token);
}