You are here

function spam_notspam_node in Spam 5

Force a node to be marked as not spam. May not publish depending on settings

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

File

./spam.module, line 3134

Code

function spam_notspam_node($nid) {
  if ($node = node_load(array(
    'nid' => $nid,
  ))) {
    $tokens = spam_tokenize($node->title, 'header*');
    $tokens = array_merge($tokens, spam_tokenize($node->body));
    spam_tokens_unsave($tokens, 0);
    spam_tokens_save($tokens, 0);
    db_query("UPDATE {spam_tracker} SET probability = %d, timestamp = %d WHERE source = 'node' AND id = %d", 1, time(), $nid);
    spam_default_actions('node', $nid, $node->title, $node->body, 1, NULL, FALSE);
    spam_log(SPAM_LOG, t('spam_page: node manually marked as not spam'), 'node', $node->nid);
  }
}