[geeklog-cvs] geeklog: "Refine search" lost the status of the "Titles Only" ch...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Nov 7 15:53:05 EST 2009
changeset 7456:4ef1c9a5915c
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/4ef1c9a5915c
user: Dirk Haun <dirk at haun-online.de>
date: Sat Nov 07 21:52:55 2009 +0100
description:
"Refine search" lost the status of the "Titles Only" checkbox
diffstat:
public_html/docs/english/theme.html | 2 ++
public_html/docs/history | 2 ++
public_html/layout/professional/search/searchform.thtml | 2 +-
system/classes/search.class.php | 11 ++++++++++-
4 files changed, 15 insertions(+), 2 deletions(-)
diffs (78 lines):
diff -r db650e2584a3 -r 4ef1c9a5915c public_html/docs/english/theme.html
--- a/public_html/docs/english/theme.html Sat Nov 07 20:39:08 2009 +0100
+++ b/public_html/docs/english/theme.html Sat Nov 07 21:52:55 2009 +0100
@@ -222,6 +222,8 @@
<li>Added a <code>{remoteservice}</code> variable in
<tt>admin/user/edituser.thtml</tt> to optionally display the name of the
service a Remote User was using to log in.</li>
+<li>Added a <code>{title_checked}</code> variable to <tt>search/searchform.thtml</tt>, so that the "Refine search" option can keep the status of the "Titles
+ Only" checkbox.</li>
</ul>
<h3>Cosmetic changes</h3>
diff -r db650e2584a3 -r 4ef1c9a5915c public_html/docs/history
--- a/public_html/docs/history Sat Nov 07 20:39:08 2009 +0100
+++ b/public_html/docs/history Sat Nov 07 21:52:55 2009 +0100
@@ -4,6 +4,8 @@
------------
Changes since 1.6.1b1:
+- "Refine search" lost the status of the "Titles Only" checkbox [Dirk]
+ Note: This fix requires a change in search/searchform.thtml
- Improved display of the "Sort by" and "Show n results" dropdowns on the
search results page (feature request #0000910) [Sami, LWC]
- Fixed wrong path reported in case of a missing 'data' directory (reported by
diff -r db650e2584a3 -r 4ef1c9a5915c public_html/layout/professional/search/searchform.thtml
--- a/public_html/layout/professional/search/searchform.thtml Sat Nov 07 20:39:08 2009 +0100
+++ b/public_html/layout/professional/search/searchform.thtml Sat Nov 07 21:52:55 2009 +0100
@@ -10,7 +10,7 @@
<option value="all" {key_all_selected}>{lang_all_words}</option>
<option value="any" {key_any_selected}>{lang_any_word}</option>
</select>
- <input type="checkbox" value="true" name="title"{xhtml}>{lang_titles}
+ <input type="checkbox" value="true" name="title"{title_checked}{xhtml}>{lang_titles}
</td>
</tr>
<tr>
diff -r db650e2584a3 -r 4ef1c9a5915c system/classes/search.class.php
--- a/system/classes/search.class.php Sat Nov 07 20:39:08 2009 +0100
+++ b/system/classes/search.class.php Sat Nov 07 21:52:55 2009 +0100
@@ -62,6 +62,7 @@
var $_searchURL = '';
var $_wordlength;
var $_verbose = false; // verbose logging
+ var $_titlesOnly = false;
/**
* Constructor
@@ -104,6 +105,8 @@
}
$this->_type = isset($_GET['type']) ? COM_applyFilter($_GET['type']) : 'all';
$this->_keyType = isset($_GET['keyType']) ? COM_applyFilter($_GET['keyType']) : $_CONF['search_def_keytype'];
+
+ $this->_titlesOnly = isset($_GET['title']) ? true : false;
}
/**
@@ -247,6 +250,11 @@
$searchform->set_var ('query', $escquery);
$searchform->set_var ('datestart', $this->_dateStart);
$searchform->set_var ('dateend', $this->_dateEnd);
+ if ($this->_titlesOnly) {
+ $searchform->set_var('title_checked', ' checked="checked"');
+ } else {
+ $searchform->set_var('title_checked', '');
+ }
$phrase_selected = '';
$all_selected = '';
@@ -453,7 +461,8 @@
((!empty($this->_dateStart)) ? '&datestart=' . $this->_dateStart : '' ) .
((!empty($this->_dateEnd)) ? '&dateend=' . $this->_dateEnd : '' ) .
((!empty($this->_topic)) ? '&topic=' . $this->_topic : '' ) .
- ((!empty($this->_author)) ? '&author=' . $this->_author : '' );
+ ((!empty($this->_author)) ? '&author=' . $this->_author : '' ) .
+ ($this->_titlesOnly ? '&title=true' : '');
$url = "{$this->_searchURL}&type={$this->_type}&mode=";
$obj = new ListFactory($url.'search', $_CONF['search_limits'], $_CONF['num_search_results']);
More information about the geeklog-cvs
mailing list