aboutsummaryrefslogtreecommitdiff
path: root/mod/search/search_hooks.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-20 00:07:22 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-20 00:07:22 +0000
commit79455e6a6f76844742b4cafdca151e7b0bba00fd (patch)
tree2a8c336db63a742d7e619d1dc3863764331bf658 /mod/search/search_hooks.php
parent43d1cc1bbe4b9c41ac8f6305aa9fe7fb48626565 (diff)
downloadelgg-79455e6a6f76844742b4cafdca151e7b0bba00fd.tar.gz
elgg-79455e6a6f76844742b4cafdca151e7b0bba00fd.tar.bz2
Fixes #1523: Updated search to use ELGG_ENTITIES_NO_VALUE/ANY_VALUE and removed some commented out code.
git-svn-id: http://code.elgg.org/elgg/trunk@3956 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search/search_hooks.php')
-rw-r--r--mod/search/search_hooks.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php
index 1c109025a..b61f12339 100644
--- a/mod/search/search_hooks.php
+++ b/mod/search/search_hooks.php
@@ -28,8 +28,6 @@ function search_objects_hook($hook, $type, $value, $params) {
$params['wheres'] = array($where);
- //$params['order_by'] = search_get_order_by_sql('oe', $params['sort'], $params['order']);
-
$entities = elgg_get_entities($params);
$params['count'] = TRUE;
$count = elgg_get_entities($params);
@@ -41,12 +39,9 @@ function search_objects_hook($hook, $type, $value, $params) {
// add the volatile data for why these entities have been returned.
foreach ($entities as $entity) {
- //$title = search_get_highlighted_relevant_substrings($entity->title, $params['query']);
- //$title = search_get_relevant_substring($entity->title, $params['query'], '<strong class="searchMatch">', '</strong>');
$title = search_get_highlighted_relevant_substrings($entity->title, $params['query']);
$entity->setVolatileData('search_matched_title', $title);
- //$desc = search_get_relevant_substring($entity->description, $params['query'], '<strong class="searchMatch">', '</strong>');
$desc = search_get_highlighted_relevant_substrings($entity->description, $params['query']);
$entity->setVolatileData('search_matched_description', $desc);
}
@@ -82,7 +77,7 @@ function search_groups_hook($hook, $type, $value, $params) {
$params['wheres'] = array($where);
// override subtype -- All groups should be returned regardless of subtype.
- $params['subtype'] = NULL;
+ $params['subtype'] = ELGG_ENTITIES_ANY_VALUE;
$entities = elgg_get_entities($params);
$params['count'] = TRUE;
@@ -133,7 +128,7 @@ function search_users_hook($hook, $type, $value, $params) {
$params['wheres'] = array($where);
// override subtype -- All users should be returned regardless of subtype.
- $params['subtype'] = NULL;
+ $params['subtype'] = ELGG_ENTITIES_ANY_VALUE;
$entities = elgg_get_entities($params);
$params['count'] = TRUE;
@@ -332,7 +327,6 @@ function search_comments_hook($hook, $type, $value, $params) {
$comments = get_data($q);
-//elgg_get_entities()
$q = "SELECT count(DISTINCT a.id) as total FROM {$CONFIG->dbprefix}annotations a
JOIN {$CONFIG->dbprefix}metastrings msn ON a.name_id = msn.id
JOIN {$CONFIG->dbprefix}metastrings msv ON a.value_id = msv.id