You are here

function spam_publish_node in Spam 5

Force a node to be published

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

File

./spam.module, line 3072

Code

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