diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-10-06 12:55:56 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-10-06 12:55:56 +0000 |
commit | 87567f8916b78b2eb8ed279b728a30ce2dce249a (patch) | |
tree | 097b0e936bc5f07cfeb3fcee7823a23a0be76f33 /modules/search/search.module | |
parent | 026af5df34694c8ca5c3708f3fe23fd10ec160cb (diff) | |
download | brdo-87567f8916b78b2eb8ed279b728a30ce2dce249a.tar.gz brdo-87567f8916b78b2eb8ed279b728a30ce2dce249a.tar.bz2 |
- Patch #310212 by justinrandell: killed in _node hook, as well as twelve sable tooth tigers.
Diffstat (limited to 'modules/search/search.module')
-rw-r--r-- | modules/search/search.module | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/modules/search/search.module b/modules/search/search.module index 022914116..245c5ee33 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -626,24 +626,25 @@ function search_touch_node($nid) { } /** - * Implementation of hook_nodeapi(). + * Implementation of hook_nodeapi_update_index(). */ -function search_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { - switch ($op) { - // Transplant links to a node into the target node. - case 'update index': - $result = db_query("SELECT caption FROM {search_node_links} WHERE nid = %d", $node->nid); - $output = array(); - while ($link = db_fetch_object($result)) { - $output[] = $link->caption; - } - return '<a>(' . implode(', ', $output) . ')</a>'; - // Reindex the node when it is updated. The node is automatically indexed - // when it is added, simply by being added to the node table. - case 'update': - search_touch_node($node->nid); - break; +function search_nodeapi_update_index(&$node, $teaser = NULL, $page = NULL) { + // Transplant links to a node into the target node. + $result = db_query("SELECT caption FROM {search_node_links} WHERE nid = %d", $node->nid); + $output = array(); + while ($link = db_fetch_object($result)) { + $output[] = $link->caption; } + return '<a>(' . implode(', ', $output) . ')</a>'; +} + +/** + * Implementation of hook_nodeapi_update(). + */ +function search_nodeapi_update(&$node, $teaser = NULL, $page = NULL) { + // Reindex the node when it is updated. The node is automatically indexed + // when it is added, simply by being added to the node table. + search_touch_node($node->nid); } /** |