You are here

function spam_mark_node_as_spam_action in Spam 6

Implementation of a Drupal action. Mark node as spam.

File

content/spam_content_node.inc, line 253
Include file for integration with the node system.

Code

function spam_mark_node_as_spam_action(&$object, $context = array()) {

  // get the nid from the object
  if (isset($object->nid)) {
    $nid = $object->nid;
  }
  elseif (isset($context['nid'])) {
    $nid = $context['nid'];
  }

  // make sure we have a node record
  if ($nid) {
    spam_mark_as_spam('node', $nid);

    // record a message noting the action taken
    watchdog('action', 'Marked node %nid as spam.', array(
      '%nid' => $nid,
    ));
  }
}