From e390b02676070d4f1e5377a96d44ea189790c4b6 Mon Sep 17 00:00:00 2001 From: tkempf Date: Wed, 1 Oct 2014 12:08:44 +0200 Subject: [PATCH] To make travis happy --- components/com_finder/models/suggestions.php | 35 +++++++++---------- .../views/search/tmpl/default_form.php | 2 +- modules/mod_finder/tmpl/default.php | 2 +- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/components/com_finder/models/suggestions.php b/components/com_finder/models/suggestions.php index 781327a10707d..29d11c32e5d7e 100644 --- a/components/com_finder/models/suggestions.php +++ b/components/com_finder/models/suggestions.php @@ -63,7 +63,7 @@ protected function getListQuery() //attempt to change mysql for error in large select $db->setQuery('SET SQL_BIG_SELECTS=1'); $db->query(); - } + } $query = $db->getQuery(true); // Set variables @@ -72,7 +72,7 @@ protected function getListQuery() $app = JFactory::getApplication(); $input = $app->input; $request = $input->request; - + // Select required fields $query->select('t.term') ->from($db->quoteName('#__finder_terms') . ' AS t') @@ -81,41 +81,40 @@ protected function getListQuery() ->where('t.language IN (' . $db->quote($db->escape($this->getState('language'), true)) . ', ' . $db->quote('*') . ')') ->order('t.links DESC') ->order('t.weight DESC'); - - $linkjoin=''; + + $linkjoin = ''; // Iterate through each term mapping table and add the join. for ($i = 0; $i < 16; $i++) { // We use the offset because each join needs a unique alias. $query->join('LEFT', $db->quoteName('#__finder_links_terms'.dechex($i)) . ' AS lterms'. $i .' ON lterms'. $i .'.term_id = t.term_id'); - $linkjoin.='lterms'.$i.'.link_id=l.link_id'; - if($i<15) - $linkjoin.=' or '; + $linkjoin .= 'lterms'.$i.'.link_id=l.link_id'; + if($i < 15) + $linkjoin .= ' or '; } - $query->join('INNER',$db->quoteName('#__finder_links') . ' AS l ON ('.$linkjoin.')') + $query->join('INNER', $db->quoteName('#__finder_links') . ' AS l ON ('.$linkjoin.')') ->where($db->quoteName('l.access') . ' IN (' . $groups . ')') ->where($db->quoteName('l.state') . ' = 1'); - + // Get the null date and the current date, minus seconds. $nullDate = $db->quote($db->getNullDate()); $nowDate = $db->quote(substr_replace(JFactory::getDate()->toSQL(), '00', -2)); - + // Add the publish up and publish down filters. $query->where('(' . $db->quoteName('l.publish_start_date') . ' = ' . $nullDate . ' OR ' . $db->quoteName('l.publish_start_date') . ' <= ' . $nowDate . ')') ->where('(' . $db->quoteName('l.publish_end_date') . ' = ' . $nullDate . ' OR ' . $db->quoteName('l.publish_end_date') . ' >= ' . $nowDate . ')'); - if (!is_null($request->get('f'))) { - $query->join('INNER',$db->quoteName('#__finder_taxonomy_map') . ' AS tm ON (tm.link_id=l.link_id)') - ->join('INNER',$db->quoteName('#__finder_filters') . ' AS ff ON (ff.data=tm.node_id)') - ->where($db->quoteName('ff.filter_id') . ' = '.$request->get('f','','int')); - + $query->join('INNER', $db->quoteName('#__finder_taxonomy_map') . ' AS tm ON (tm.link_id=l.link_id)') + ->join('INNER', $db->quoteName('#__finder_filters') . ' AS ff ON (ff.data=tm.node_id)') + ->where($db->quoteName('ff.filter_id') . ' = '.$request->get('f', '', 'int')); + } -/* +/* * Didn't know what these do, so i commented them out - * + * // Add the start date filter to the query. if (!empty($this->query->date1)) { @@ -156,7 +155,7 @@ protected function getListQuery() $query->where($db->quoteName('l.start_date') . ' = ' . $date2); } } -*/ +*/ return $query; } diff --git a/components/com_finder/views/search/tmpl/default_form.php b/components/com_finder/views/search/tmpl/default_form.php index 49295b5b550c5..05fa133926e8e 100644 --- a/components/com_finder/views/search/tmpl/default_form.php +++ b/components/com_finder/views/search/tmpl/default_form.php @@ -42,7 +42,7 @@ $script .= " var suggest = jQuery('#q').autocomplete({ - serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component&f='.$params->get('searchfilter'), false) . "', + serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component&f=' . $params->get('searchfilter'), false) . "', paramName: 'q', minChars: 1, maxHeight: 400, diff --git a/modules/mod_finder/tmpl/default.php b/modules/mod_finder/tmpl/default.php index ccd2bc94ab1c6..b6e95385d6805 100644 --- a/modules/mod_finder/tmpl/default.php +++ b/modules/mod_finder/tmpl/default.php @@ -128,7 +128,7 @@ $script .= " var suggest = jQuery('#mod-finder-searchword').autocomplete({ - serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component&f='.$params->get('searchfilter'), false) . "', + serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component&f=' . $params->get('searchfilter'), false) . "', paramName: 'q', minChars: 1, maxHeight: 400,