You are here

function _linkchecker_unpublish_nodes in Link checker 6.2

Same name and namespace in other branches
  1. 5.2 linkchecker.module \_linkchecker_unpublish_nodes()
  2. 7 linkchecker.module \_linkchecker_unpublish_nodes()

Unpublishes all nodes having the specified link id.

Parameters

int $lid: A link ID that have reached a defined failcount.

1 call to _linkchecker_unpublish_nodes()
_linkchecker_status_handling in ./linkchecker.module
Status code handling.

File

./linkchecker.module, line 1876
This module periodically check links in given node types, blocks, cck fields, etc.

Code

function _linkchecker_unpublish_nodes($lid) {
  $res = db_query("SELECT * FROM {linkchecker_nodes} WHERE lid = %d", $lid);
  while ($row = db_fetch_object($res)) {
    $node = node_load(array(
      'nid' => $row->nid,
    ));
    $node->status = 0;
    node_save($node);
    watchdog('linkchecker', 'Set @type %title to unpublished.', array(
      '@type' => $node->type,
      '%title' => $node->title,
    ));
  }
}