diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-16 01:56:18 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-16 01:56:18 +0000 |
commit | fc5ef85ec2fa45afb44795109899d93329f7b2c4 (patch) | |
tree | 8d8f958ca42012c2ea753136859f54eda7796ab7 /mod/search/search_hooks.php | |
parent | f29b327342068543b8a2a3f0f487953468f3c9a5 (diff) | |
download | elgg-fc5ef85ec2fa45afb44795109899d93329f7b2c4.tar.gz elgg-fc5ef85ec2fa45afb44795109899d93329f7b2c4.tar.bz2 |
Merged [5623]:head from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5760 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search/search_hooks.php')
-rw-r--r-- | mod/search/search_hooks.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php index 1af208d6e..a2063dbc1 100644 --- a/mod/search/search_hooks.php +++ b/mod/search/search_hooks.php @@ -240,8 +240,21 @@ function search_tags_hook($hook, $type, $value, $params) { } } + // different entities have different titles + switch($entity->type) { + case 'site': + case 'user': + case 'group': + $title_tmp = $entity->name; + break; + + case 'object': + $title_tmp = $entity->title; + break; + } + // Nick told me my idea was dirty, so I'm hard coding the numbers. - $title_tmp = strip_tags($entity->title); + $title_tmp = strip_tags($title_tmp); if (elgg_strlen($title_tmp) > 297) { $title_str = elgg_substr($title_tmp, 0, 297) . '...'; } else { @@ -257,7 +270,6 @@ function search_tags_hook($hook, $type, $value, $params) { $tags_str = implode('. ', $matched_tags_strs); $tags_str = search_get_highlighted_relevant_substrings($tags_str, $params['query']); - //$tags_str = "($tags_str)"; $entity->setVolatileData('search_matched_title', $title_str); $entity->setVolatileData('search_matched_description', $desc_str); @@ -392,4 +404,4 @@ function search_comments_hook($hook, $type, $value, $params) { function search_custom_types_comments_hook($hook, $type, $value, $params) { $value[] = 'comments'; return $value; -}
\ No newline at end of file +} |