Is it possible that a author of an node get points, when a user let a comment on this node.

It would be great. its a good feature especially for the content profile module.

Comments

dafeder’s picture

Bump - I'm going to be working on something that does this for d7. Still don't see a module with this built-in.

dafeder’s picture

I didn't end up doing this on D7. Here is some code to do this on D6, using hook_comment. This will give the node author 2 points for each comment on her post.

/**
 * Implements hook_comment().
 * Adds a point assignment for when a post gets commented on
 */
function mymodule_comment(&$comment, $op) {
  switch ($op) {
    case 'insert':
      $node = node_load($comment['nid']);
      $params = array(
        'uid' => $node->uid,
        'points' => 2,
        'operation' => 'comment on',
        'reference' => 'comment_on',
        'display' => false,
        'entity_id' => $comment['nid'],
        'entity_type' => 'node',
      );
      userpoints_userpointsapi($params);
      break;
  }
}