Download & Extend

Points for a comment on an own created node

Project:User points Nodes and Comments
Version:6.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

#1

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

#2

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.

<?php
/**
* 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;
  }
}
?>