diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-04-27 22:20:51 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-04-27 22:20:51 +0000 |
commit | 954cbf7c65f70c3fe1f866198c09561253aab62a (patch) | |
tree | e468456666b1adca03744da0c85afd587ab4207f | |
parent | 546f5930a471af31b7c50a52e0a5a6088acb9b0e (diff) | |
download | brdo-954cbf7c65f70c3fe1f866198c09561253aab62a.tar.gz brdo-954cbf7c65f70c3fe1f866198c09561253aab62a.tar.bz2 |
#60729: Index taxonomy terms with nodes
-rw-r--r-- | modules/node.module | 2 | ||||
-rw-r--r-- | modules/node/node.module | 2 | ||||
-rw-r--r-- | modules/taxonomy.module | 16 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 16 |
4 files changed, 34 insertions, 2 deletions
diff --git a/modules/node.module b/modules/node.module index 5be1c0289..3a57c1c87 100644 --- a/modules/node.module +++ b/modules/node.module @@ -716,6 +716,8 @@ function node_search($op = 'search', $keys = null) { // Fetch comments for snippet $node->body .= module_invoke('comment', 'nodeapi', $node, 'update index'); + // Fetch terms for snippet + $node->body .= module_invoke('taxonomy', 'nodeapi', $node, 'update index'); $extra = node_invoke_nodeapi($node, 'search result'); $results[] = array('link' => url('node/'. $item->sid), diff --git a/modules/node/node.module b/modules/node/node.module index 5be1c0289..3a57c1c87 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -716,6 +716,8 @@ function node_search($op = 'search', $keys = null) { // Fetch comments for snippet $node->body .= module_invoke('comment', 'nodeapi', $node, 'update index'); + // Fetch terms for snippet + $node->body .= module_invoke('taxonomy', 'nodeapi', $node, 'update index'); $extra = node_invoke_nodeapi($node, 'search result'); $results[] = array('link' => url('node/'. $item->sid), diff --git a/modules/taxonomy.module b/modules/taxonomy.module index dedab9429..149f8bf84 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -1182,7 +1182,21 @@ function taxonomy_nodeapi($node, $op, $arg = 0) { break; case 'rss item': return taxonomy_rss_item($node); - break; + case 'update index': + return taxonomy_node_update_index($node); + } +} + +/** + * Implementation of hook_nodeapi('update_index'). + */ +function taxonomy_node_update_index(&$node) { + $output = array(); + foreach ($node->taxonomy as $term) { + $output[] = $term->name; + } + if (count($output)) { + return '<strong>('. implode(', ', $output) .')</strong>'; } } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index dedab9429..149f8bf84 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1182,7 +1182,21 @@ function taxonomy_nodeapi($node, $op, $arg = 0) { break; case 'rss item': return taxonomy_rss_item($node); - break; + case 'update index': + return taxonomy_node_update_index($node); + } +} + +/** + * Implementation of hook_nodeapi('update_index'). + */ +function taxonomy_node_update_index(&$node) { + $output = array(); + foreach ($node->taxonomy as $term) { + $output[] = $term->name; + } + if (count($output)) { + return '<strong>('. implode(', ', $output) .')</strong>'; } } |