You are here

function fivestar_comment_insert in Fivestar 5

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

Insert a fivestar comment value.

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

File

./fivestar_comment.module, line 171

Code

function fivestar_comment_insert($cid, $nid, $uid, $value) {
  $vote = _fivestar_cast_vote('node', $nid, $value, 'vote', $uid);
  votingapi_recalculate_results('node', $nid);
  db_query('INSERT INTO {fivestar_comment} (cid, vote_id, value) VALUES (%d, %d, %d)', $cid, $vote->vote_id, $value);
}