From: Andrea Zagli Date: Sat, 2 Jan 2010 14:17:17 +0000 (+0100) Subject: Bugfixes. Pagination. Some search parameters. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=d577367cbb215263f73dd9241d93462f9518de1b;p=joomla%2Fjmnogosearch Bugfixes. Pagination. Some search parameters. --- diff --git a/com_jmnogosearch/admin/en-GB.com_jmnogosearch.ini b/com_jmnogosearch/admin/en-GB.com_jmnogosearch.ini new file mode 100755 index 0000000..3d1b435 --- /dev/null +++ b/com_jmnogosearch/admin/en-GB.com_jmnogosearch.ini @@ -0,0 +1,19 @@ +# $Id: en-GB.com_search.ini 10388 2008-06-03 11:16:20Z pasamio $ +# Joomla! Project +# Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. +# License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php +# Note : All ini files need to be saved as UTF-8 - No BOM + +DESCSEARCH=This Component manages the Search functionality. +GATHER SEARCH STATISTICS=Gather Search Statistics +HIDE SEARCH RESULTS=Hide Search Results +RESULTS RETURNED=Results Returned +SEARCH LOGGING=Search Logging +SEARCH STATISTICS=Search Statistics +SEARCH TEXT=Search Text +SHOW CREATED DATE=Show Created Date +SHOW SEARCH RESULTS=Show Search Results +STANDARD SEARCH FORM=Standard Search Form +STANDARD SEARCH LAYOUT DESC=The standard Search layout displays the Search Form and result. +TIMES REQUESTED=Times Requested +TIPSEARCHSTATISTICS=Enable/Disable collection of site statistics \ No newline at end of file diff --git a/com_jmnogosearch/site/en-GB.com_jmnogosearch.ini b/com_jmnogosearch/site/en-GB.com_jmnogosearch.ini new file mode 100755 index 0000000..718e104 --- /dev/null +++ b/com_jmnogosearch/site/en-GB.com_jmnogosearch.ini @@ -0,0 +1,27 @@ +# $Id: en-GB.com_search.ini 10498 2008-07-04 00:05:36Z ian $ +# author Joomla! Project +# Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. +# license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php + +# Note : All ini files need to be saved as UTF-8 + +ALL WORDS=All words +ALPHABETICAL=Alphabetical +ANY WORDS=Any words +DISPLAY NUM=Display # +EXACT PHRASE=Exact Phrase +IGNOREKEYWORD=One or more common words were ignored in the search. +RELEVANCY=Relevancy +NEWEST FIRST=Newest First +NO RESULTS WERE FOUND=No results were found. +OLDEST FIRST=Oldest First +ORDERING=Ordering +SEARCH=Search +SEARCH KEYWORD=Search Keyword +SEARCH_MESSAGE=Search term must be a minimum of 3 characters and a maximum of 20 characters. +SEARCH ONLY=Search Only +TOTALRESULTSFOUND=Total: %s results found. +WITH=with +SEARCH_AGAIN=Search Again +SEARCH_RESULT=Search Result +SEARCH PARAMETERS=Search Parameters diff --git a/com_jmnogosearch/site/models/jmnogosearch.php b/com_jmnogosearch/site/models/jmnogosearch.php index 4e4abbf..8c2dd21 100644 --- a/com_jmnogosearch/site/models/jmnogosearch.php +++ b/com_jmnogosearch/site/models/jmnogosearch.php @@ -69,7 +69,7 @@ class JMnoGoSearchModelJMnoGoSearch extends JModel // Set the search parameters $keyword = urldecode(JRequest::getString('searchword')); $match = JRequest::getWord('searchphrase', 'all'); - $ordering = JRequest::getWord('ordering', 'newest'); + $ordering = JRequest::getWord('ordering', 'relevancy'); $this->setSearch($keyword, $match, $ordering); } @@ -113,14 +113,33 @@ class JMnoGoSearchModelJMnoGoSearch extends JModel $keyword = $this->getState('keyword'); if (trim($keyword) != '') { + $ordering = $this->getState('ordering'); + $match = $this->getState('match'); + + if ($ordering == 'relevancy') { + } else if ($ordering == 'newest') { + } else if ($ordering == 'older') { + } else if ($ordering == 'title') { + } + + if ($match == 'all') { + udm_set_agent_param ($this->_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_ALL); + } else if ($match == 'any') { + udm_set_agent_param ($this->_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_ANY); + } else if ($match == 'exact') { + udm_set_agent_param ($this->_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_PHRASE); + } + + $limit = $this->getState('limit'); + $limitstart = $this->getState('limitstart'); + udm_set_agent_param ($this->_agent, UDM_PARAM_PAGE_SIZE, $limit); + + $npage = $limitstart / $limit; + udm_set_agent_param ($this->_agent, UDM_PARAM_PAGE_NUM, $npage); + $mResult = udm_find ($this->_agent, $keyword); $this->_total = udm_get_res_param ($mResult, UDM_PARAM_FOUND); - /*if ($this->getState('limit') > 0) { - $this->_data = array_splice($rows, $this->getState('limitstart'), $this->getState('limit')); - } else { - $this->_data = $rows; - }*/ $this->_data = $mResult; } else { $this->_total = 0; diff --git a/com_jmnogosearch/site/views/jmnogosearch/tmpl/default_form.php b/com_jmnogosearch/site/views/jmnogosearch/tmpl/default_form.php index 4eab7ce..7a53507 100644 --- a/com_jmnogosearch/site/views/jmnogosearch/tmpl/default_form.php +++ b/com_jmnogosearch/site/views/jmnogosearch/tmpl/default_form.php @@ -52,10 +52,10 @@ - pagination->getLimitBox( ); ?> + pagination->getLimitBox( ); ?>
- pagination->getPagesCounter(); ?> + pagination->getPagesCounter(); ?>
diff --git a/com_jmnogosearch/site/views/jmnogosearch/tmpl/default_results.php b/com_jmnogosearch/site/views/jmnogosearch/tmpl/default_results.php index dd3eff0..7cba39f 100644 --- a/com_jmnogosearch/site/views/jmnogosearch/tmpl/default_results.php +++ b/com_jmnogosearch/site/views/jmnogosearch/tmpl/default_results.php @@ -4,11 +4,12 @@ total > 0) { foreach( $this->results as $result ) : ?>
- pagination->limitstart + $result->count.'. ';?> + count.'. ';?> href ) : if ($result->browsernav == 1 ) : ?> @@ -32,13 +33,15 @@
- +
- pagination->getPagesLinks( ); ?> + pagination->getPagesLinks( ); ?>
diff --git a/com_jmnogosearch/site/views/jmnogosearch/view.html.php b/com_jmnogosearch/site/views/jmnogosearch/view.html.php index e2771b7..8ed961d 100644 --- a/com_jmnogosearch/site/views/jmnogosearch/view.html.php +++ b/com_jmnogosearch/site/views/jmnogosearch/view.html.php @@ -108,15 +108,16 @@ class JMnoGoSearchViewJMnoGoSearch extends JView $results = &$this->get('data'); $total = &$this->get('total'); - //$pagination = &$this->get('pagination'); + $pagination = &$this->get('pagination'); require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php'); - if ($results != null) + if ($total > 0) { $firstRow = udm_get_res_param ($results, UDM_PARAM_FIRST_DOC); $lastRow = udm_get_res_param ($results, UDM_PARAM_LAST_DOC); - for ($i = $firstRow - 1; $i < $lastRow; $i++) + $rows = $lastRow - $firstRow + 1; + for ($i = 0; $i < $rows; $i++) { $row = new stdClass(); $row->text = udm_get_res_field ($results, $i, UDM_FIELD_TEXT);