summaryrefslogtreecommitdiff
path: root/modules/search
diff options
context:
space:
mode:
Diffstat (limited to 'modules/search')
-rw-r--r--modules/search/search.module48
1 files changed, 36 insertions, 12 deletions
diff --git a/modules/search/search.module b/modules/search/search.module
index 5c07acb31..4f13ec030 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -659,19 +659,43 @@ function search_nodeapi_update($node) {
}
/**
- * Implementation of hook_comment().
+ * Implementation of hook_comment_insert().
*/
-function search_comment($a1, $op) {
- switch ($op) {
- // Reindex the node when comments are added or changed
- case 'insert':
- case 'update':
- case 'delete':
- case 'publish':
- case 'unpublish':
- search_touch_node(is_array($a1) ? $a1['nid'] : $a1->nid);
- break;
- }
+function search_comment_insert($form_values) {
+ // Reindex the node when comments are added.
+ search_touch_node($form_values['nid']);
+}
+
+/**
+ * Implementation of hook_comment_update().
+ */
+function search_comment_update($form_values) {
+ // Reindex the node when comments are changed.
+ search_touch_node($form_values['nid']);
+}
+
+/**
+ * Implementation of hook_comment_delete().
+ */
+function search_comment_delete($comment) {
+ // Reindex the node when comments are deleted.
+ search_touch_node($comment->nid);
+}
+
+/**
+ * Implementation of hook_comment_publish().
+ */
+function search_comment_publish($form_values) {
+ // Reindex the node when comments are published.
+ search_touch_node($form_values['nid']);
+}
+
+/**
+ * Implementation of hook_comment_unpublish().
+ */
+function search_comment_unpublish($comment) {
+ // Reindex the node when comments are unpublished.
+ search_touch_node($comment->nid);
}
/**