欢迎各位兄弟 发布技术文章
这里的技术是共享的
if (node_access('delete', $node)) {
db_query('DELETE FROM {node} WHERE nid = %d', $node->nid);
db_query('DELETE FROM {node_revisions} WHERE nid = %d', $node->nid);
drupal_set_message(t('@type %title has been deleted.', array('@type' => node_get_types('name', $node), '%title' => $node->title)));
}
switch ($op) {
case 'name':
return t('Content');
case 'reset':
db_query("UPDATE {search_dataset} SET reindex = %d WHERE type = 'node'", time());
return;
}