function _spam_comment_score in Spam 5.3
Retreive spam score, caching in memory for repeated use.
2 calls to _spam_comment_score()
- comment_comment in modules/
spam_comment.inc - Drupal _comment() hook.
- comment_spamapi_form_alter in modules/
spam_comment.inc - Form alter gets it's own function so we can reference &$form without causing errors in PHP4 installations. (If we use spamapi, we have to set a default, which PHP4 doesn't support.)
File
- modules/
spam_comment.inc, line 284
Code
function _spam_comment_score($cid) {
static $scores = array();
if (!isset($scores[$cid])) {
$scores[$cid] = db_result(db_query("SELECT score FROM {spam_tracker} WHERE content_type = 'comment' AND content_id = %d", $cid));
}
return $scores[$cid];
}