// Include the helper. require_once __DIR__ . '/helper.php'; if (!defined('FINDER_PATH_INDEXER')) { define('FINDER_PATH_INDEXER', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer'); } JLoader::register('FinderIndexerQuery', FINDER_PATH_INDEXER . '/query.php'); // Check for OpenSearch if ($params->get('opensearch', 1)) { /* This code intentionally commented $doc = JFactory::getDocument(); $app = JFactory::getApplication(); $ostitle = $params->get('opensearch_title', JText::_('MOD_FINDER_SEARCHBUTTON_TEXT') . ' ' . $app->getCfg('sitename')); $doc->addHeadLink( JURI::getInstance()->toString(array('scheme', 'host', 'port')) . JRoute::_('&option=com_finder&format=opensearch'), 'search', 'rel', array('title' => $ostitle, 'type' => 'application/opensearchdescription+xml') ); */ } // Initialize module parameters. $params->def('field_size', 20); // Get the route. $route = FinderHelperRoute::getSearchRoute($params->get('searchfilter', null)); // Load component language file. FinderHelperLanguage::loadComponentLanguage(); // Load plug-in language files. FinderHelperLanguage::loadPluginLanguage(); // Get Smart Search query object. $query = modFinderHelper::getQuery($params); require JModuleHelper::getLayoutPath('mod_finder', $params->get('layout', 'default'));
JPluginHelper::importPlugin('content'); $dispatcher = JDispatcher::getInstance(); // Include menu itemid's in URLs by forming $itemids lookup array //$itemids = makeMenuItemArray('content_blog_section'); $itemids = $this->menuitemarray; foreach ($rows as $row) { $item = new FeedItem(); $item->title = htmlspecialchars($row->title); $itemid = $itemids[$row->sectionid]; // be sure itemid has some content! /*>>> AGE 20071012 */ if ($itemid == "" && $finder_exists) { //$itemid = $mainframe->getItemid( $row->id, 0, 0 ); // Get the menu item id. //$query = array('id' => $row->id); $itemid = FinderHelperRoute::getItemid($row->id); } /*<<< AGE 20071012 */ if ($itemid == "") { $itemid = 99999999; } $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug), false, 2); $item->guid = $item->link; //Jroute produces htmlspecialchar modified urls. //We need to decode them because the feedclass also specialchars them, giving us things like &amp; //TODO - test special characters //$itemurl = htmlspecialchars_decode ($itemurl); /* >> DAN 2009/12/14 */ /* fulltext options: * 0 -> Do nothing * 1 -> Read more link
/** * Method to convert the query object into a URI string. * * @param string $base The base URI. [optional] * * @return string The complete query URI. * * @since 2.5 */ public function toURI($base = null) { // Set the base if not specified. if (empty($base)) { $base = 'index.php?option=com_finder&view=search'; } // Get the base URI. $uri = JUri::getInstance($base); // Add the static taxonomy filter if present. if (!empty($this->filter)) { $uri->setVar('f', $this->filter); } // Get the filters in the request. $input = JFactory::getApplication()->input; $t = $input->request->get('t', array(), 'array'); // Add the dynamic taxonomy filters if present. if (!empty($this->filters)) { foreach ($this->filters as $nodes) { foreach ($nodes as $node) { if (!in_array($node, $t)) { continue; } $uri->setVar('t[]', $node); } } } // Add the input string if present. if (!empty($this->input)) { $uri->setVar('q', $this->input); } // Add the start date if present. if (!empty($this->date1)) { $uri->setVar('d1', $this->date1); } // Add the end date if present. if (!empty($this->date2)) { $uri->setVar('d2', $this->date2); } // Add the start date modifier if present. if (!empty($this->when1)) { $uri->setVar('w1', $this->when1); } // Add the end date modifier if present. if (!empty($this->when2)) { $uri->setVar('w2', $this->when2); } // Add a menu item id if one is not present. if (!$uri->getVar('Itemid')) { // Get the menu item id. $query = array('view' => $uri->getVar('view'), 'f' => $uri->getVar('f'), 'q' => $uri->getVar('q')); $item = FinderHelperRoute::getItemid($query); // Add the menu item id if present. if ($item !== null) { $uri->setVar('Itemid', $item); } } return $uri->toString(array('path', 'query')); }
// Include the helper. require_once dirname(__FILE__) . '/helper.php'; if (!defined('FINDER_PATH_INDEXER')) { define('FINDER_PATH_INDEXER', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer'); } JLoader::register('FinderIndexerQuery', FINDER_PATH_INDEXER . '/query.php'); // Check for OpenSearch if ($params->get('opensearch', 1)) { /* This code intentionally commented $doc = JFactory::getDocument(); $app = JFactory::getApplication(); $ostitle = $params->get('opensearch_title', JText::_('MOD_FINDER_SEARCHBUTTON_TEXT') . ' ' . $app->getCfg('sitename')); $doc->addHeadLink( JURI::getInstance()->toString(array('scheme', 'host', 'port')) . JRoute::_('&option=com_finder&format=opensearch'), 'search', 'rel', array('title' => $ostitle, 'type' => 'application/opensearchdescription+xml') ); */ } // Initialize module parameters. $params->def('field_size', 20); // Get the route. $route = FinderHelperRoute::getSearchRoute($params->get('f', null)); // Load component language file. FinderHelperLanguage::loadComponentLanguage(); // Load plug-in language files. FinderHelperLanguage::loadPluginLanguage(); // Get Smart Search query object. $query = modFinderHelper::getQuery($params); require JModuleHelper::getLayoutPath('mod_finder', $params->get('layout', 'default'));