You are here

function spam_unpublish_node in Spam 5

Force a node to be unpublished

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

File

./spam.module, line 3084

Code

function spam_unpublish_node($nid) {
  if ($node = node_load(array(
    'nid' => $nid,
  ))) {
    db_query('UPDATE {node} SET status = 0 WHERE nid = %d', $node->nid);
    cache_clear_all();
    watchdog('spam', t('Spam: unpublished @type "%subject".', array(
      '@type' => node_get_types('name', $node),
      '%subject' => $node->title,
    )));
    spam_log(SPAM_LOG, t('spam_unpublish_node: unpublished node "%title".', array(
      '%title' => $node->title,
    )), 'node', $node->nid);
  }
}