Index: link_checker/link_checker.module
===================================================================
--- link_checker/link_checker.module	(revision 93)
+++ link_checker/link_checker.module	(working copy)
@@ -58,13 +58,16 @@
     '#options' => array(1=>1, 2=>2, 5=>5, 10=>10),
     '#default_value' => variable_get('link_checker_batch_quantity', NULL),
 	);
-  $form['link_checker_unpublish'] = array(
-	'#type' => 'checkbox',
-	'#title' => t('Unpublish nodes with 404 links?'),
-	'#description' => t('If set to yes and node is found to have one or more links that returns a 404 error 
-		the node will be automatically unpublished'),
-	'#default_value' => variable_get('link_checker_unpublish', NULL),
+
+
+	$form['link_checker_unpublish'] = array(
+  	'#type' => 'textfield',
+  	'#title' => t('Unpublish threshold'),
+  	'#size' => 5,
+  	'#description' => t('Number of consecutive CRON runs that detect an error to occur before unpublishing the related node, note, not all links are checked at every cron run due to the above setting. Enter 0 for never unpublish'),
+  	'#default_value' => variable_get('link_checker_unpublish', 0),
 	);
+	
   //check for which nodes have link fields
   foreach (node_get_types() as $type => $name) {
     $fields = content_fields(NULL, $type);
@@ -153,6 +156,8 @@
       return;
     }
   }
+  
+  static $link_threshold_check;
 
   //Code originally written in the janode project at http://drupal.org/project/janode, thanks! 
 
@@ -226,9 +231,22 @@
 	db_query($sql, $link->nid, $link->vid, $link->delta, $status, $link->field_name);
   }
 
-  // unpublish and force the node into the moderation queue 
-  if ((int)$status > _LINK_CHECKER_FAILURE_PIVOT && variable_get('link_checker_unpublish', NULL)) {
-	//The user would like all errors above 300 unpublished.. ok we'll do that. 
-    db_query("UPDATE {node} SET status = 0, moderate = 1 WHERE nid = %d", $link->nid);
+  // this seems to execute more than once for the same field, so better be safe
+  if(@!isset($link_threshold_check["{$link->vid}-{$link->delta}"])) {
+    // unpublish and force the node into the moderation queue 
+    if ((int)$status > _LINK_CHECKER_FAILURE_PIVOT && variable_get('link_checker_unpublish',0) >0) {
+  	//The user would like all errors above 300 unpublished.. ok we'll do that. 
+      db_query("UPDATE {link_checker} set error_count = error_count+1 where vid=%d and delta =%d",$link->vid, $link->delta );
+      $result = db_query("SELECT error_count from {link_checker} where vid=%d and delta =%d",$link->vid, $link->delta );
+      $stat = db_fetch_array($result);
+      if($stat['error_count'] >= variable_get('link_checker_unpublish',0)) {
+        // @todo you could work in someting from actions module here instead?
+        db_query("UPDATE {node} SET status = 0, moderate = 1 WHERE nid = %d", $link->nid);
+      }
+    } else {
+      // we dont care for, or we need to reset the error_count
+      db_query("UPDATE {link_checker} set error_count = 0 where vid=%d and delta =%d",$link->vid, $link->delta );
+    }
   }
+  $link_threshold_check["{$link->vid}-{$link->delta}"]=true;
 }
Index: link_checker/link_checker.install
===================================================================
--- link_checker/link_checker.install	(revision 93)
+++ link_checker/link_checker.install	(working copy)
@@ -50,7 +50,14 @@
   }
 } // end install function
 
-
+function link_checker_update_1() {
+  if(variable_get('link_checker_unpublish', NULL)) {
+    variable_set('link_checker_unpublish', 1);
+  }
+  $ret = update_db("ALTER TABLE link_checker add column error_count int default 0;");
+  return $ret;
+  
+}
 /*
 * Implementation of hook_uninstall 
 */
