You are here

function userpoints_comment in User Points 5.2

Same name and namespace in other branches
  1. 5.3 userpoints_basic.module \userpoints_comment()
  2. 5 userpoints_basic.module \userpoints_comment()

File

./userpoints_basic.module, line 90

Code

function userpoints_comment($comment, $op) {
  global $user;
  static $orig_uid;
  $points = variable_get(USERPOINTS_POST_COMMENT, 0);
  switch ($op) {
    case 'insert':
      userpoints_userpointsapi('points', $points, $user->uid, 'post comment');
      break;
    case 'delete':
      $points = -$points;
      userpoints_userpointsapi('points', $points, $comment->uid, 'post comment');
      break;
    case 'moderate':
      $points = variable_get(USERPOINTS_MODERATE_COMMENT, 0);
      userpoints_userpointsapi('points', $points, $comment->uid, 'moderate comment');
      break;
    case 'form':
      $orig_uid = $comment['uid']['#value'];
    case 'update':
      break;
  }
}