drupal7: node作者被删后,对node重设uid

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

$nids = db_query('SELECT nid FROM node WHERE NOT EXISTS(SELECT NULL FROM users WHERE users.uid = node.uid)')->fetchCol();
foreach($nids as $nid) {
	$node = node_load($nid);
	$node->uid = 0;
	node_save($node);
}