diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-11-08 00:09:09 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-11-08 00:09:09 +0000 |
commit | b02f17540195e1c9f933b40b0176a6f01bf1be6d (patch) | |
tree | aa0b71e005f4b3dfe6ea96b10234ac31137e3753 /mod/search/views/default | |
parent | 963a9ab35f58f1f3ff5ca2822aed3b908717bb68 (diff) | |
download | elgg-b02f17540195e1c9f933b40b0176a6f01bf1be6d.tar.gz elgg-b02f17540195e1c9f933b40b0176a6f01bf1be6d.tar.bz2 |
Added super-basic support for searching comments.
git-svn-id: http://code.elgg.org/elgg/trunk@3636 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search/views/default')
-rw-r--r-- | mod/search/views/default/search/comments/listing.php | 34 | ||||
-rw-r--r-- | mod/search/views/default/search/listing.php | 2 | ||||
-rw-r--r-- | mod/search/views/default/search/tags/listing.php | 2 |
3 files changed, 37 insertions, 1 deletions
diff --git a/mod/search/views/default/search/comments/listing.php b/mod/search/views/default/search/comments/listing.php new file mode 100644 index 000000000..ba9b7ea6e --- /dev/null +++ b/mod/search/views/default/search/comments/listing.php @@ -0,0 +1,34 @@ +<?php +/** + * Elgg comments search listing + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ + +foreach ($vars['entities'] as $entity) { + if ($owner = $entity->getOwnerEntity()) { + $owner_icon = $owner->getIcon('tiny'); + $icon = "<img src=\"$owner_icon\" />"; + } else { + $icon = ''; + } + $title = "Comment on " . elgg_echo('item:' . $entity->getType() . ':' . $entity->getSubtype()); + $description = $entity->getVolatileData('search_matched_comment'); + $url = $entity->getURL(); + $title = "<a href=\"$url\">$title</a>"; + $tc = $entity->getVolatileData('search_matched_comment_time_created');; + $time = friendly_time($tc); + + echo <<<___END +<span class="searchListing"> + <h3 class="searchTitle">$title</h3> + <span class="searchDetails"> + <span class="searchDescription">$description</span><br /> + $icon $time - $more</a> + </span> +</span> +___END; +}
\ No newline at end of file diff --git a/mod/search/views/default/search/listing.php b/mod/search/views/default/search/listing.php index 270e33267..23a6a44e8 100644 --- a/mod/search/views/default/search/listing.php +++ b/mod/search/views/default/search/listing.php @@ -26,6 +26,8 @@ $query = htmlspecialchars(http_build_query( array( 'q' => $vars['params']['query'], 'type' => $vars['params']['type'], + 'limit' => get_input('limit', 10), + 'offset' => get_input('offset', 0), 'subtype' => $vars['params']['subtype'] ) )); diff --git a/mod/search/views/default/search/tags/listing.php b/mod/search/views/default/search/tags/listing.php index a5a33c4a4..9b229b349 100644 --- a/mod/search/views/default/search/tags/listing.php +++ b/mod/search/views/default/search/tags/listing.php @@ -1,6 +1,6 @@ <?php /** - * Elgg search listing + * Elgg tag search listing * * @package Elgg * @subpackage Core |