aboutsummaryrefslogtreecommitdiff
path: root/mod/search
diff options
context:
space:
mode:
Diffstat (limited to 'mod/search')
-rw-r--r--mod/search/search_hooks.php18
-rw-r--r--mod/search/views/default/search/css.php7
-rw-r--r--mod/search/views/default/search/entity.php4
3 files changed, 19 insertions, 10 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
+}
diff --git a/mod/search/views/default/search/css.php b/mod/search/views/default/search/css.php
index 72b696059..d008dd3c0 100644
--- a/mod/search/views/default/search/css.php
+++ b/mod/search/views/default/search/css.php
@@ -78,12 +78,7 @@
}
/* formatting for the search results */
-.search_listing .item_extra {
- border: 1px solid #cccccc;
- margin: 2px;
- padding: 3px;
-}
.search_listing .item_timestamp {
font-style: italic;
-} \ No newline at end of file
+}
diff --git a/mod/search/views/default/search/entity.php b/mod/search/views/default/search/entity.php
index 538cc8a64..e5659d6ab 100644
--- a/mod/search/views/default/search/entity.php
+++ b/mod/search/views/default/search/entity.php
@@ -42,9 +42,11 @@ $title = $entity->getVolatileData('search_matched_title');
$description = $entity->getVolatileData('search_matched_description');
$extra_info = $entity->getVolatileData('search_matched_extra');
$url = $entity->getVolatileData('search_url');
+
if (!$url) {
$url = $entity->getURL();
}
+
$title = "<a href=\"$url\">$title</a>";
$time = $entity->getVolatileData('search_time');
if (!$time) {
@@ -53,7 +55,7 @@ if (!$time) {
$time = friendly_time(($tu > $tc) ? $tu : $tc);
}
?>
- <div class="search_listing clearfloat">
+ <div class="search_listing">
<div class="search_listing_icon"><?php echo $icon; ?></div>
<div class="search_listing_info">
<p class="entity_title"><?php echo $title; ?></p>