You are here

function fivestar_comment_delete in Fivestar 6

Same name and namespace in other branches
  1. 5 fivestar_comment.module \fivestar_comment_delete()
  2. 6.2 fivestar_comment.module \fivestar_comment_delete()

Delete any value for a comment and update their vote.

1 call to fivestar_comment_delete()
fivestar_comment in ./fivestar_comment.module
Implementation of hook_comment().

File

./fivestar_comment.module, line 190

Code

function fivestar_comment_delete($cid, $nid, $vote_id) {
  db_query('DELETE FROM {fivestar_comment} WHERE cid = %d', $cid);
  $vote = array();
  $vote['content_id'] = $nid;
  $vote['content_type'] = 'node';
  $vote['vote_id'] = $vote_id;
  votingapi_delete_votes(array(
    $vote,
  ));
  votingapi_recalculate_results('node', $nid);
}