You are here

function spam_spam_comment in Spam 5

Mark the comment as spam. This may cause the comment to become unpublished depending on settings

1 string reference to 'spam_spam_comment'
spam_comment_operations in ./spam.module
Return the function to call dependant on the $action requested.

File

./spam.module, line 3030

Code

function spam_spam_comment($cid) {
  if ($comment = spam_load_comment($cid)) {
    $tokens = spam_tokenize($comment->subject, 'header*');
    $tokens = array_merge($tokens, spam_tokenize("{$comment->comment}  {$comment->name} {$comment->mail} {$comment->homepage}"));
    spam_tokens_unsave($tokens, 1);
    spam_tokens_save($tokens, 1);
    db_query("UPDATE {spam_tracker} SET probability = %d, timestamp = %d WHERE source = 'comment' AND id = %d", 99, time(), $cid);
    if (!db_affected_rows()) {
      db_query("INSERT INTO {spam_tracker} (id, source, probability, hostname, hash, timestamp) VALUES(%d, '%s', %d, '%s', '%s', %d)", $cid, 'comment', 99, $_SERVER['REMOTE_ADDR'], md5($comment->subject . $comment->comment), time());
    }
    spam_default_actions('comment', $cid, $comment->subject, $comment->comment, 99, NULL, FALSE, 1);
    spam_log(SPAM_LOG, t('spam_page: comment manually marked as spam'), 'comment', $comment->cid);
  }
}