aboutsummaryrefslogtreecommitdiff
path: root/mod/search/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-07 20:57:32 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-07 20:57:32 +0000
commit24e3ff747614364d0d44fc1a7644f164146c66e1 (patch)
treecab9495aa3a6daf5c1aa3bac6de61e3436e77380 /mod/search/views
parent413ea817c78a2cd7cbe3bebad1623daaaeea6394 (diff)
downloadelgg-24e3ff747614364d0d44fc1a7644f164146c66e1.tar.gz
elgg-24e3ff747614364d0d44fc1a7644f164146c66e1.tar.bz2
Moved default search hooks into search mod.
Using MySQL's MATCH ... AGAINST instead of likes for most searches. Changed 'tag' to 'q' while maintaining backward compatibility. git-svn-id: http://code.elgg.org/elgg/trunk@3633 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search/views')
-rw-r--r--mod/search/views/default/page_elements/searchbox.php2
-rw-r--r--mod/search/views/default/search/listing.php15
2 files changed, 14 insertions, 3 deletions
diff --git a/mod/search/views/default/page_elements/searchbox.php b/mod/search/views/default/page_elements/searchbox.php
index 4bab36be9..cfc0b953b 100644
--- a/mod/search/views/default/page_elements/searchbox.php
+++ b/mod/search/views/default/page_elements/searchbox.php
@@ -1,4 +1,4 @@
<form id="searchform" action="<?php echo $vars['url']; ?>pg/search/" method="get">
- <input type="text" size="21" name="tag" value="<?php echo elgg_echo('search'); ?>" onclick="if (this.value=='<?php echo elgg_echo('search'); ?>') { this.value='' }" class="search_input" />
+ <input type="text" size="21" name="q" value="<?php echo elgg_echo('search'); ?>" onclick="if (this.value=='<?php echo elgg_echo('search'); ?>') { this.value='' }" class="search_input" />
<input type="submit" value="<?php echo elgg_echo('search:go'); ?>" class="search_submit_button" />
</form>
diff --git a/mod/search/views/default/search/listing.php b/mod/search/views/default/search/listing.php
index 2ed657547..270e33267 100644
--- a/mod/search/views/default/search/listing.php
+++ b/mod/search/views/default/search/listing.php
@@ -13,7 +13,7 @@
<?php
$entities = $vars['entities'];
-$count = $vars['count'];
+$count = $vars['count'] - count($vars['entities']);
if (!is_array($vars['entities']) || !count($vars['entities'])) {
return FALSE;
@@ -22,6 +22,17 @@ if (!is_array($vars['entities']) || !count($vars['entities'])) {
$title_str = elgg_echo("item:{$vars['params']['type']}:{$vars['params']['subtype']}");
$body = elgg_view_title($title_str);
+$query = htmlspecialchars(http_build_query(
+ array(
+ 'q' => $vars['params']['query'],
+ 'type' => $vars['params']['type'],
+ 'subtype' => $vars['params']['subtype']
+ )
+));
+
+$url = "{$vars['url']}pg/search?$query";
+$more = "<a href=\"$url\">+$count more $title_str</a>";
+
echo elgg_view('page_elements/contentwrapper', array('body' => $body));
foreach ($entities as $entity) {
@@ -44,7 +55,7 @@ foreach ($entities as $entity) {
<h3 class="searchTitle">$title</h3>
<span class="searchDetails">
<span class="searchDescription">$description</span><br />
- $icon - $time - <a href="">More $title_str</a> -
+ $icon $time - $more</a>
</span>
</span>
___END;