php drupal7: node作者被删后,对node重设uid
drupal7: node作者被删后,对node重设uid [代码片段(6行)]
$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); }
精彩图集
精彩文章