By anrn on
I have a problem with my module for giving assess by submit original knobs in comments. I cannot pull ‘cid’ for VotingAPI module
example:
/* hook_comment in time of creating, I think comment already has ID
*/
function tcomment_comment($comment, $op) {
switch ($op) {
case 'publish':
tcomment_add_votes($comment->cid);
}
}
/* I use VotingAPI module for storage data. The ‘cid’ is nothing here. Why?
*/
function tcomment_add_votes($cid) {
$votes[] = array(
'content_type' => 'comment',
'content_id' => $cid,
'value_type' => 'points',
'value' => 1,
);
votingapi_set_votes($votes);
}
Comments
I solve it <?php$cid =
I solve it
http://drupal.org/node/369520
ye, realy, only select max. I
ye, realy, only select max. I think it's hack, not hook, but don't know the best way)