Spade

Mini Shell

Directory:~$ /home/lmsyaran/www/css/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/www/css/search.zip

PKo�[���l��categories/categories.phpnu�[���<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Search.categories
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

JLoader::register('ContentHelperRoute', JPATH_SITE .
'/components/com_content/helpers/route.php');

/**
 * Categories search plugin.
 *
 * @since  1.6
 */
class PlgSearchCategories extends JPlugin
{
	/**
	 * Load the language file on instantiation.
	 *
	 * @var    boolean
	 * @since  3.1
	 */
	protected $autoloadLanguage = true;

	/**
	 * Determine areas searchable by this plugin.
	 *
	 * @return  array  An array of search areas.
	 *
	 * @since   1.6
	 */
	public function onContentSearchAreas()
	{
		static $areas = array(
			'categories' =>
'PLG_SEARCH_CATEGORIES_CATEGORIES'
		);

		return $areas;
	}

	/**
	 * Search content (categories).
	 *
	 * The SQL must return the following fields that are used in a common
display
	 * routine: href, title, section, created, text, browsernav.
	 *
	 * @param   string  $text      Target search string.
	 * @param   string  $phrase    Matching option (possible values:
exact|any|all).  Default is "any".
	 * @param   string  $ordering  Ordering option (possible values:
newest|oldest|popular|alpha|category).  Default is "newest".
	 * @param   mixed   $areas     An array if the search is to be restricted
to areas or null to search all areas.
	 *
	 * @return  array  Search results.
	 *
	 * @since   1.6
	 */
	public function onContentSearch($text, $phrase = '', $ordering =
'', $areas = null)
	{
		$db = JFactory::getDbo();
		$user = JFactory::getUser();
		$app = JFactory::getApplication();
		$groups = implode(',', $user->getAuthorisedViewLevels());
		$searchText = $text;

		if (is_array($areas) && !array_intersect($areas,
array_keys($this->onContentSearchAreas())))
		{
			return array();
		}

		$sContent = $this->params->get('search_content', 1);
		$sArchived = $this->params->get('search_archived', 1);
		$limit = $this->params->def('search_limit', 50);
		$state = array();

		if ($sContent)
		{
			$state[] = 1;
		}

		if ($sArchived)
		{
			$state[] = 2;
		}

		if (empty($state))
		{
			return array();
		}

		$text = trim($text);

		if ($text === '')
		{
			return array();
		}

		/* TODO: The $where variable does not seem to be used at all
		switch ($phrase)
		{
			case 'exact':
				$text = $db->quote('%' . $db->escape($text, true) .
'%', false);
				$wheres2 = array();
				$wheres2[] = 'a.title LIKE ' . $text;
				$wheres2[] = 'a.description LIKE ' . $text;
				$where = '(' . implode(') OR (', $wheres2) .
')';
				break;

			case 'any':
			case 'all';
			default:
				$words = explode(' ', $text);
				$wheres = array();
				foreach ($words as $word)
				{
					$word = $db->quote('%' . $db->escape($word, true) .
'%', false);
					$wheres2 = array();
					$wheres2[] = 'a.title LIKE ' . $word;
					$wheres2[] = 'a.description LIKE ' . $word;
					$wheres[] = implode(' OR ', $wheres2);
				}
				$where = '(' . implode(($phrase == 'all' ? ')
AND (' : ') OR ('), $wheres) . ')';
				break;
		}
		*/

		switch ($ordering)
		{
			case 'alpha':
				$order = 'a.title ASC';
				break;

			case 'category':
			case 'popular':
			case 'newest':
			case 'oldest':
			default:
				$order = 'a.title DESC';
		}

		$text = $db->quote('%' . $db->escape($text, true) .
'%', false);
		$query = $db->getQuery(true);

		// SQLSRV changes.
		$case_when = ' CASE WHEN ';
		$case_when .= $query->charLength('a.alias', '!=',
'0');
		$case_when .= ' THEN ';
		$a_id = $query->castAsChar('a.id');
		$case_when .= $query->concatenate(array($a_id, 'a.alias'),
':');
		$case_when .= ' ELSE ';
		$case_when .= $a_id . ' END as slug';
		$query->select('a.title, a.description AS text, a.created_time AS
created, \'2\' AS browsernav, a.id AS catid, ' . $case_when)
			->from('#__categories AS a')
			->where(
				'(a.title LIKE ' . $text . ' OR a.description LIKE
' . $text . ') AND a.published IN (' .
implode(',', $state) . ') AND a.extension = '
				. $db->quote('com_content') . 'AND a.access IN
(' . $groups . ')'
			)
			->group('a.id, a.title, a.description, a.alias,
a.created_time')
			->order($order);

		if ($app->isClient('site') &&
JLanguageMultilang::isEnabled())
		{
			$query->where('a.language in (' .
$db->quote(JFactory::getLanguage()->getTag()) . ',' .
$db->quote('*') . ')');
		}

		$db->setQuery($query, 0, $limit);

		try
		{
			$rows = $db->loadObjectList();
		}
		catch (RuntimeException $e)
		{
			$rows = array();
			JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'),
'error');
		}

		$return = array();

		if ($rows)
		{
			foreach ($rows as $i => $row)
			{
				if (searchHelper::checkNoHtml($row, $searchText,
array('name', 'title', 'text')))
				{
					$row->href = ContentHelperRoute::getCategoryRoute($row->slug);
					$row->section = JText::_('JCATEGORY');

					$return[] = $row;
				}
			}
		}

		return $return;
	}
}
PKo�[�#�zcategories/categories.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin"
group="search" method="upgrade">
	<name>plg_search_categories</name>
	<author>Joomla! Project</author>
	<creationDate>November 2005</creationDate>
	<copyright>Copyright (C) 2005 - 2020 Open Source Matters. All rights
reserved.</copyright>
	<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
	<authorEmail>admin@joomla.org</authorEmail>
	<authorUrl>www.joomla.org</authorUrl>
	<version>3.0.0</version>
	<description>PLG_SEARCH_CATEGORIES_XML_DESCRIPTION</description>
	<files>
		<filename
plugin="categories">categories.php</filename>
	</files>
	<languages>
		<language
tag="en-GB">en-GB.plg_search_categories.ini</language>
		<language
tag="en-GB">en-GB.plg_search_categories.sys.ini</language>
	</languages>
	<config>
		<fields name="params">

			<fieldset name="basic">
				<field
					name="search_limit"
					type="number"
					label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL"
					description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC"
					default="50"
					filter="integer"
					size="5"
				/>

				<field
					name="search_content"
					type="radio"
					label="JFIELD_PLG_SEARCH_ALL_LABEL"
					description="JFIELD_PLG_SEARCH_ALL_DESC"
					class="btn-group btn-group-yesno"
					default="0"
					filter="integer"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>

				<field
					name="search_archived"
					type="radio"
					label="JFIELD_PLG_SEARCH_ARCHIVED_LABEL"
					description="JFIELD_PLG_SEARCH_ARCHIVED_DESC"
					class="btn-group btn-group-yesno"
					default="0"
					filter="integer"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>
			</fieldset>

		</fields>
	</config>
</extension>
PKo�[�s�YDDcontacts/contacts.phpnu�[���<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Search.contacts
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Contacts search plugin.
 *
 * @since  1.6
 */
class PlgSearchContacts extends JPlugin
{
	/**
	 * Load the language file on instantiation.
	 *
	 * @var    boolean
	 * @since  3.1
	 */
	protected $autoloadLanguage = true;

	/**
	 * Determine areas searchable by this plugin.
	 *
	 * @return  array  An array of search areas.
	 *
	 * @since   1.6
	 */
	public function onContentSearchAreas()
	{
		static $areas = array(
			'contacts' => 'PLG_SEARCH_CONTACTS_CONTACTS'
		);

		return $areas;
	}

	/**
	 * Search content (contacts).
	 *
	 * The SQL must return the following fields that are used in a common
display
	 * routine: href, title, section, created, text, browsernav.
	 *
	 * @param   string  $text      Target search string.
	 * @param   string  $phrase    Matching option (possible values:
exact|any|all).  Default is "any".
	 * @param   string  $ordering  Ordering option (possible values:
newest|oldest|popular|alpha|category).  Default is "newest".
	 * @param   string  $areas     An array if the search is to be restricted
to areas or null to search all areas.
	 *
	 * @return  array  Search results.
	 *
	 * @since   1.6
	 */
	public function onContentSearch($text, $phrase = '', $ordering =
'', $areas = null)
	{
		JLoader::register('ContactHelperRoute', JPATH_SITE .
'/components/com_contact/helpers/route.php');

		$db     = JFactory::getDbo();
		$app    = JFactory::getApplication();
		$user   = JFactory::getUser();
		$groups = implode(',', $user->getAuthorisedViewLevels());

		if (is_array($areas) && !array_intersect($areas,
array_keys($this->onContentSearchAreas())))
		{
			return array();
		}

		$sContent  = $this->params->get('search_content', 1);
		$sArchived = $this->params->get('search_archived', 1);
		$limit     = $this->params->def('search_limit', 50);
		$state     = array();

		if ($sContent)
		{
			$state[] = 1;
		}

		if ($sArchived)
		{
			$state[] = 2;
		}

		if (empty($state))
		{
			return array();
		}

		$text = trim($text);

		if ($text === '')
		{
			return array();
		}

		$section = JText::_('PLG_SEARCH_CONTACTS_CONTACTS');

		switch ($ordering)
		{
			case 'alpha':
				$order = 'a.name ASC';
				break;

			case 'category':
				$order = 'c.title ASC, a.name ASC';
				break;

			case 'popular':
			case 'newest':
			case 'oldest':
			default:
				$order = 'a.name DESC';
		}

		$text = $db->quote('%' . $db->escape($text, true) .
'%', false);

		$query = $db->getQuery(true);

		// SQLSRV changes.
		$case_when  = ' CASE WHEN ';
		$case_when .= $query->charLength('a.alias', '!=',
'0');
		$case_when .= ' THEN ';
		$a_id = $query->castAsChar('a.id');
		$case_when .= $query->concatenate(array($a_id, 'a.alias'),
':');
		$case_when .= ' ELSE ';
		$case_when .= $a_id . ' END as slug';

		$case_when1  = ' CASE WHEN ';
		$case_when1 .= $query->charLength('c.alias', '!=',
'0');
		$case_when1 .= ' THEN ';
		$c_id        = $query->castAsChar('c.id');
		$case_when1 .= $query->concatenate(array($c_id, 'c.alias'),
':');
		$case_when1 .= ' ELSE ';
		$case_when1 .= $c_id . ' END as catslug';

		$query->select(
			'a.name AS title, \'\' AS created, a.con_position,
a.misc, '
				. $case_when . ',' . $case_when1 . ', '
				. $query->concatenate(array('a.name',
'a.con_position', 'a.misc'), ',') . ' AS
text,'
				. $query->concatenate(array($db->quote($section),
'c.title'), ' / ') . ' AS section,'
				. '\'2\' AS browsernav'
		);
		$query->from('#__contact_details AS a')
			->join('INNER', '#__categories AS c ON c.id =
a.catid')
			->where(
				'(a.name LIKE ' . $text . ' OR a.misc LIKE ' .
$text . ' OR a.con_position LIKE ' . $text
					. ' OR a.address LIKE ' . $text . ' OR a.suburb LIKE
' . $text . ' OR a.state LIKE ' . $text
					. ' OR a.country LIKE ' . $text . ' OR a.postcode LIKE
' . $text . ' OR a.telephone LIKE ' . $text
					. ' OR a.fax LIKE ' . $text . ') AND a.published IN
(' . implode(',', $state) . ') AND c.published=1 '
					. ' AND a.access IN (' . $groups . ') AND c.access IN
(' . $groups . ')'
			)
			->order($order);

		// Filter by language.
		if ($app->isClient('site') &&
JLanguageMultilang::isEnabled())
		{
			$tag = JFactory::getLanguage()->getTag();
			$query->where('a.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')')
				->where('c.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')');
		}

		$db->setQuery($query, 0, $limit);

		try
		{
			$rows = $db->loadObjectList();
		}
		catch (RuntimeException $e)
		{
			$rows = array();
			JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'),
'error');
		}

		if ($rows)
		{
			foreach ($rows as $key => $row)
			{
				$rows[$key]->href  =
ContactHelperRoute::getContactRoute($row->slug, $row->catslug);
				$rows[$key]->text  = $row->title;
				$rows[$key]->text .= $row->con_position ? ', ' .
$row->con_position : '';
				$rows[$key]->text .= $row->misc ? ', ' . $row->misc
: '';
			}
		}

		return $rows;
	}
}
PKo�[Tjr���contacts/contacts.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin"
group="search" method="upgrade">
	<name>plg_search_contacts</name>
	<author>Joomla! Project</author>
	<creationDate>November 2005</creationDate>
	<copyright>Copyright (C) 2005 - 2020 Open Source Matters. All rights
reserved.</copyright>
	<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
	<authorEmail>admin@joomla.org</authorEmail>
	<authorUrl>www.joomla.org</authorUrl>
	<version>3.0.0</version>
	<description>PLG_SEARCH_CONTACTS_XML_DESCRIPTION</description>
	<files>
		<filename plugin="contacts">contacts.php</filename>
	</files>
	<languages>
		<language
tag="en-GB">en-GB.plg_search_contacts.ini</language>
		<language
tag="en-GB">en-GB.plg_search_contacts.sys.ini</language>
	</languages>
	<config>
		<fields name="params">
			<fieldset name="basic">
				<field
					name="search_limit"
					type="number"
					label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL"
					description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC"
					default="50"
					filter="integer"
					size="5"
				/>

				<field
					name="search_content"
					type="radio"
					label="JFIELD_PLG_SEARCH_ALL_LABEL"
					description="JFIELD_PLG_SEARCH_ALL_DESC"
					class="btn-group btn-group-yesno"
					default="0"
					filter="integer"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>

				<field
					name="search_archived"
					type="radio"
					label="JFIELD_PLG_SEARCH_ARCHIVED_LABEL"
					description="JFIELD_PLG_SEARCH_ARCHIVED_DESC"
					class="btn-group btn-group-yesno"
					default="0"
					filter="integer"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>
PKo�[y�ê�4�4content/content.phpnu�[���<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Search.content
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Content search plugin.
 *
 * @since  1.6
 */
class PlgSearchContent extends JPlugin
{
	/**
	 * Determine areas searchable by this plugin.
	 *
	 * @return  array  An array of search areas.
	 *
	 * @since   1.6
	 */
	public function onContentSearchAreas()
	{
		static $areas = array(
			'content' => 'JGLOBAL_ARTICLES'
		);

		return $areas;
	}

	/**
	 * Search content (articles).
	 * The SQL must return the following fields that are used in a common
display
	 * routine: href, title, section, created, text, browsernav.
	 *
	 * @param   string  $text      Target search string.
	 * @param   string  $phrase    Matching option (possible values:
exact|any|all).  Default is "any".
	 * @param   string  $ordering  Ordering option (possible values:
newest|oldest|popular|alpha|category).  Default is "newest".
	 * @param   mixed   $areas     An array if the search it to be restricted
to areas or null to search all areas.
	 *
	 * @return  array  Search results.
	 *
	 * @since   1.6
	 */
	public function onContentSearch($text, $phrase = '', $ordering =
'', $areas = null)
	{
		$db         = JFactory::getDbo();
		$serverType = $db->getServerType();
		$app        = JFactory::getApplication();
		$user       = JFactory::getUser();
		$groups     = implode(',',
$user->getAuthorisedViewLevels());
		$tag        = JFactory::getLanguage()->getTag();

		JLoader::register('ContentHelperRoute', JPATH_SITE .
'/components/com_content/helpers/route.php');
		JLoader::register('SearchHelper', JPATH_ADMINISTRATOR .
'/components/com_search/helpers/search.php');

		$searchText = $text;

		if (is_array($areas) && !array_intersect($areas,
array_keys($this->onContentSearchAreas())))
		{
			return array();
		}

		$sContent  = $this->params->get('search_content', 1);
		$sArchived = $this->params->get('search_archived', 1);
		$limit     = $this->params->def('search_limit', 50);

		$nullDate  = $db->getNullDate();
		$date      = JFactory::getDate();
		$now       = $date->toSql();

		$text = trim($text);

		if ($text === '')
		{
			return array();
		}

		switch ($phrase)
		{
			case 'exact':
				$text      = $db->quote('%' . $db->escape($text, true)
. '%', false);
				$wheres2   = array();
				$wheres2[] = 'a.title LIKE ' . $text;
				$wheres2[] = 'a.introtext LIKE ' . $text;
				$wheres2[] = 'a.fulltext LIKE ' . $text;
				$wheres2[] = 'a.metakey LIKE ' . $text;
				$wheres2[] = 'a.metadesc LIKE ' . $text;

				$relevance[] = ' CASE WHEN ' . $wheres2[0] . ' THEN 5
ELSE 0 END ';

				// Join over Fields.
				$subQuery = $db->getQuery(true);
				$subQuery->select("cfv.item_id")
					->from("#__fields_values AS cfv")
					->join('LEFT', '#__fields AS f ON f.id =
cfv.field_id')
					->where('(f.context IS NULL OR f.context = ' .
$db->q('com_content.article') . ')')
					->where('(f.state IS NULL OR f.state = 1)')
					->where('(f.access IS NULL OR f.access IN (' . $groups .
'))')
					->where('cfv.value LIKE ' . $text);

				// Filter by language.
				if ($app->isClient('site') &&
JLanguageMultilang::isEnabled())
				{
					$subQuery->where('(f.language IS NULL OR f.language in ('
. $db->quote($tag) . ',' . $db->quote('*') .
'))');
				}

				if ($serverType == "mysql")
				{
					/* This generates a dependent sub-query so do no use in MySQL prior to
version 6.0 !
					* $wheres2[] = 'a.id IN( '. (string)
$subQuery.')';
					*/

					$db->setQuery($subQuery);
					$fieldids = $db->loadColumn();

					if (count($fieldids))
					{
						$wheres2[] = 'a.id IN(' . implode(",", $fieldids)
. ')';
					}
				}
				else
				{
					$wheres2[] = $subQuery->castAsChar('a.id') . ' IN(
' . (string) $subQuery . ')';
				}

				$where = '(' . implode(') OR (', $wheres2) .
')';
				break;

			case 'all':
			case 'any':
			default:
				$words = explode(' ', $text);
				$wheres = array();
				$cfwhere = array();

				foreach ($words as $word)
				{
					$word      = $db->quote('%' . $db->escape($word, true)
. '%', false);
					$wheres2   = array();
					$wheres2[] = 'LOWER(a.title) LIKE LOWER(' . $word .
')';
					$wheres2[] = 'LOWER(a.introtext) LIKE LOWER(' . $word .
')';
					$wheres2[] = 'LOWER(a.fulltext) LIKE LOWER(' . $word .
')';
					$wheres2[] = 'LOWER(a.metakey) LIKE LOWER(' . $word .
')';
					$wheres2[] = 'LOWER(a.metadesc) LIKE LOWER(' . $word .
')';

					$relevance[] = ' CASE WHEN ' . $wheres2[0] . ' THEN 5
ELSE 0 END ';

					if ($phrase === 'all')
					{
						// Join over Fields.
						$subQuery = $db->getQuery(true);
						$subQuery->select("cfv.item_id")
							->from("#__fields_values AS cfv")
							->join('LEFT', '#__fields AS f ON f.id =
cfv.field_id')
							->where('(f.context IS NULL OR f.context = ' .
$db->q('com_content.article') . ')')
							->where('(f.state IS NULL OR f.state = 1)')
							->where('(f.access IS NULL OR f.access IN (' . $groups
. '))')
							->where('LOWER(cfv.value) LIKE LOWER(' . $word .
')');

						// Filter by language.
						if ($app->isClient('site') &&
JLanguageMultilang::isEnabled())
						{
							$subQuery->where('(f.language IS NULL OR f.language in
(' . $db->quote($tag) . ',' .
$db->quote('*') . '))');
						}

						if ($serverType == "mysql")
						{
							$db->setQuery($subQuery);
							$fieldids = $db->loadColumn();

							if (count($fieldids))
							{
								$wheres2[] = 'a.id IN(' . implode(",",
$fieldids) . ')';
							}
						}
						else
						{
							$wheres2[] = $subQuery->castAsChar('a.id') . ' IN(
' . (string) $subQuery . ')';
						}
					}
					else
					{
						$cfwhere[] = 'LOWER(cfv.value) LIKE LOWER(' . $word .
')';
					}

					$wheres[] = implode(' OR ', $wheres2);
				}

				if ($phrase === 'any')
				{
					// Join over Fields.
					$subQuery = $db->getQuery(true);
					$subQuery->select("cfv.item_id")
						->from("#__fields_values AS cfv")
						->join('LEFT', '#__fields AS f ON f.id =
cfv.field_id')
						->where('(f.context IS NULL OR f.context = ' .
$db->q('com_content.article') . ')')
						->where('(f.state IS NULL OR f.state = 1)')
						->where('(f.access IS NULL OR f.access IN (' . $groups .
'))')
						->where('(' . implode(($phrase === 'all' ?
') AND (' : ') OR ('), $cfwhere) . ')');

					// Filter by language.
					if ($app->isClient('site') &&
JLanguageMultilang::isEnabled())
					{
						$subQuery->where('(f.language IS NULL OR f.language in
(' . $db->quote($tag) . ',' .
$db->quote('*') . '))');
					}

					if ($serverType == "mysql")
					{
						$db->setQuery($subQuery);
						$fieldids = $db->loadColumn();

						if (count($fieldids))
						{
							$wheres[] = 'a.id IN(' . implode(",", $fieldids)
. ')';
						}
					}
					else
					{
						$wheres[] = $subQuery->castAsChar('a.id') . ' IN(
' . (string) $subQuery . ')';
					}
				}

				$where = '(' . implode(($phrase === 'all' ? ')
AND (' : ') OR ('), $wheres) . ')';
				break;
		}

		switch ($ordering)
		{
			case 'oldest':
				$order = 'a.created ASC';
				break;

			case 'popular':
				$order = 'a.hits DESC';
				break;

			case 'alpha':
				$order = 'a.title ASC';
				break;

			case 'category':
				$order = 'c.title ASC, a.title ASC';
				break;

			case 'newest':
			default:
				$order = 'a.created DESC';
				break;
		}

		$rows = array();
		$query = $db->getQuery(true);

		// Search articles.
		if ($sContent && $limit > 0)
		{
			$query->clear();

			// SQLSRV changes.
			$case_when  = ' CASE WHEN ';
			$case_when .= $query->charLength('a.alias', '!=',
'0');
			$case_when .= ' THEN ';
			$a_id       = $query->castAsChar('a.id');
			$case_when .= $query->concatenate(array($a_id, 'a.alias'),
':');
			$case_when .= ' ELSE ';
			$case_when .= $a_id . ' END as slug';

			$case_when1  = ' CASE WHEN ';
			$case_when1 .= $query->charLength('c.alias',
'!=', '0');
			$case_when1 .= ' THEN ';
			$c_id        = $query->castAsChar('c.id');
			$case_when1 .= $query->concatenate(array($c_id, 'c.alias'),
':');
			$case_when1 .= ' ELSE ';
			$case_when1 .= $c_id . ' END as catslug';

			if (!empty($relevance))
			{
				$query->select(implode(' + ', $relevance) . ' AS
relevance');
				$order = ' relevance DESC, ' . $order;
			}

			$query->select('a.title AS title, a.metadesc, a.metakey,
a.created AS created, a.language, a.catid')
				->select($query->concatenate(array('a.introtext',
'a.fulltext')) . ' AS text')
				->select('c.title AS section, ' . $case_when .
',' . $case_when1 . ', ' . '\'2\' AS
browsernav')
				->from('#__content AS a')
				->join('INNER', '#__categories AS c ON
c.id=a.catid')
				->where(
					'(' . $where . ') AND a.state=1 AND c.published = 1 AND
a.access IN (' . $groups . ') '
						. 'AND c.access IN (' . $groups . ')'
						. 'AND (a.publish_up = ' . $db->quote($nullDate) .
' OR a.publish_up <= ' . $db->quote($now) . ') '
						. 'AND (a.publish_down = ' . $db->quote($nullDate) .
' OR a.publish_down >= ' . $db->quote($now) . ')'
				)
				->group('a.id, a.title, a.metadesc, a.metakey, a.created,
a.language, a.catid, a.introtext, a.fulltext, c.title, a.alias, c.alias,
c.id')
				->order($order);

			// Filter by language.
			if ($app->isClient('site') &&
JLanguageMultilang::isEnabled())
			{
				$query->where('a.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')')
					->where('c.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')');
			}

			$db->setQuery($query, 0, $limit);

			try
			{
				$list = $db->loadObjectList();
			}
			catch (RuntimeException $e)
			{
				$list = array();
				JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'),
'error');
			}

			$limit -= count($list);

			if (isset($list))
			{
				foreach ($list as $key => $item)
				{
					$list[$key]->href =
ContentHelperRoute::getArticleRoute($item->slug, $item->catid,
$item->language);
				}
			}

			$rows[] = $list;
		}

		// Search archived content.
		if ($sArchived && $limit > 0)
		{
			$query->clear();

			// SQLSRV changes.
			$case_when  = ' CASE WHEN ';
			$case_when .= $query->charLength('a.alias', '!=',
'0');
			$case_when .= ' THEN ';
			$a_id       = $query->castAsChar('a.id');
			$case_when .= $query->concatenate(array($a_id, 'a.alias'),
':');
			$case_when .= ' ELSE ';
			$case_when .= $a_id . ' END as slug';

			$case_when1  = ' CASE WHEN ';
			$case_when1 .= $query->charLength('c.alias',
'!=', '0');
			$case_when1 .= ' THEN ';
			$c_id        = $query->castAsChar('c.id');
			$case_when1 .= $query->concatenate(array($c_id, 'c.alias'),
':');
			$case_when1 .= ' ELSE ';
			$case_when1 .= $c_id . ' END as catslug';

			if (!empty($relevance))
			{
				$query->select(implode(' + ', $relevance) . ' AS
relevance');
				$order = ' relevance DESC, ' . $order;
			}

			$query->select('a.title AS title, a.metadesc, a.metakey,
a.created AS created, a.language, a.catid')
				->select($query->concatenate(array('a.introtext',
'a.fulltext')) . ' AS text')
				->select('c.title AS section, ' . $case_when .
',' . $case_when1 . ', ' . '\'2\' AS
browsernav')
				->from('#__content AS a')
				->join('INNER', '#__categories AS c ON c.id=a.catid
AND c.access IN (' . $groups . ')')
				->where(
					'(' . $where . ') AND a.state = 2 AND c.published = 1
AND a.access IN (' . $groups
						. ') AND c.access IN (' . $groups . ') '
						. 'AND (a.publish_up = ' . $db->quote($nullDate) .
' OR a.publish_up <= ' . $db->quote($now) . ') '
						. 'AND (a.publish_down = ' . $db->quote($nullDate) .
' OR a.publish_down >= ' . $db->quote($now) . ')'
				)
				->order($order);

			// Join over Fields is no longer needed

			// Filter by language.
			if ($app->isClient('site') &&
JLanguageMultilang::isEnabled())
			{
				$query->where('a.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')')
					->where('c.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')');
			}

			$db->setQuery($query, 0, $limit);

			try
			{
				$list3 = $db->loadObjectList();
			}
			catch (RuntimeException $e)
			{
				$list3 = array();
				JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'),
'error');
			}

			if (isset($list3))
			{
				foreach ($list3 as $key => $item)
				{
					$list3[$key]->href =
ContentHelperRoute::getArticleRoute($item->slug, $item->catid,
$item->language);
				}
			}

			$rows[] = $list3;
		}

		$results = array();

		if (count($rows))
		{
			foreach ($rows as $row)
			{
				$new_row = array();

				foreach ($row as $article)
				{
					// Not efficient to get these ONE article at a TIME
					// Lookup field values so they can be checked, GROUP_CONCAT would work
in above queries, but isn't supported by non-MySQL DBs.
					$query = $db->getQuery(true);
					$query->select('fv.value')
						->from('#__fields_values as fv')
						->join('left', '#__fields as f on fv.field_id =
f.id')
						->where('f.context = ' .
$db->quote('com_content.article'))
						->where('fv.item_id = ' . $db->quote((int)
$article->slug));
					$db->setQuery($query);
					$article->jcfields = implode(',', $db->loadColumn());

					if (SearchHelper::checkNoHtml($article, $searchText,
array('text', 'title', 'jcfields',
'metadesc', 'metakey')))
					{
						$new_row[] = $article;
					}
				}

				$results = array_merge($results, (array) $new_row);
			}
		}

		return $results;
	}

}
PKo�[���  content/content.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin"
group="search" method="upgrade">
	<name>plg_search_content</name>
	<author>Joomla! Project</author>
	<creationDate>November 2005</creationDate>
	<copyright>Copyright (C) 2005 - 2020 Open Source Matters. All rights
reserved.</copyright>
	<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
	<authorEmail>admin@joomla.org</authorEmail>
	<authorUrl>www.joomla.org</authorUrl>
	<version>3.0.0</version>
	<description>PLG_SEARCH_CONTENT_XML_DESCRIPTION</description>
	<files>
		<filename plugin="content">content.php</filename>
	</files>
	<languages>
		<language
tag="en-GB">en-GB.plg_search_content.ini</language>
		<language
tag="en-GB">en-GB.plg_search_content.sys.ini</language>
	</languages>
	<config>
		<fields name="params">
			<fieldset name="basic">
				<field
					name="search_limit"
					type="number"
					label="PLG_SEARCH_CONTENT_FIELD_SEARCHLIMIT_LABEL"
					description="PLG_SEARCH_CONTENT_FIELD_SEARCHLIMIT_DESC"
					default="50"
					filter="integer"
					size="5"
				/>

				<field
					name="search_content"
					type="radio"
					label="PLG_SEARCH_CONTENT_FIELD_CONTENT_LABEL"
					description="PLG_SEARCH_CONTENT_FIELD_CONTENT_DESC"
					class="btn-group btn-group-yesno"
					default="1"
					filter="integer"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>

				<field
					name="search_archived"
					type="radio"
					label="PLG_SEARCH_CONTENT_FIELD_ARCHIVED_LABEL"
					description="PLG_SEARCH_CONTENT_FIELD_ARCHIVED_DESC"
					class="btn-group btn-group-yesno"
					default="1"
					filter="integer"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>
			</fieldset>

		</fields>
	</config>
</extension>
PKo�[�E��)hikamarket_vendors/hikamarket_vendors.phpnu�[���<?php
/**
 * @package    HikaMarket for Joomla!
 * @version    3.1.1
 * @author     Obsidev S.A.R.L.
 * @copyright  (C) 2011-2020 OBSIDEV. All rights reserved.
 * @license    GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
class plgSearchHikamarket_vendors extends JPlugin {

	public function __construct(&$subject, $config) {
		$this->loadLanguage('com_hikamarket');
		$this->loadLanguage('plg_search_hikamarket_vendors');
		$this->loadLanguage('plg_search_hikamarket_vendors_override');
		parent::__construct($subject, $config);
		if(!isset($this->params)) {
			$plugin = JPluginHelper::getPlugin('search',
'hikamarket_vendors');
			$this->params = new JRegistry($plugin->params);
		}
	}

	public function onContentSearchAreas() {
		return $this->onSearchAreas();
	}

	public function onContentSearch($text, $phrase = '', $ordering =
'', $areas = null) {
		return $this->onSearch($text, $phrase, $ordering, $areas);
	}

	public function &onSearchAreas() {
		$areas = array(
			'vendors' => JText::_('HIKA_VENDORS')
		);
		return $areas;
	}

	public function onSearch($text, $phrase = '', $ordering =
'', $areas = null) {
		if(!defined('DS'))
			define('DS', DIRECTORY_SEPARATOR);
		if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikamarket'.DS.'helpers'.DS.'helper.php'))
			return array();

		$db	= JFactory::getDBO();

		if(is_array($areas)) {
			if(!array_intersect($areas, array_keys( $this->onSearchAreas() )))
				return array();
		}

		$limit = $this->params->def('search_limit', 50);
		$add_image = $this->params->def('add_image', 0);
		$text = trim($text);
		if(empty($text))
			return array();

		switch($ordering) {
			case 'alpha':
				$order = 'vendor.vendor_name ASC';
				break;
			case 'newest':
				$order = 'vendor.vendor_created DESC, vendor.vendor_id
DESC';
				break;
			case 'oldest':
				$order = 'vendor.vendor_created ASC, vendor.vendor_id DESC';
				break;
			case 'category':
			case 'popular':
			default:
				$order = 'vendor.vendor_name DESC';
				break;
		}

		$rows = array();

		$filters = array(
			'vendor.vendor_published = 1'
		);

		$filters2 = array();

		$fields = $this->params->get('fields', '');
		if(empty($fields)) {
			$fields = array('vendor_name',
'vendor_description');
		} else {
			$fields = explode(',', $fields);
		}

		switch($phrase){
			case 'exact':
				$text = $db->Quote('%' . hikamarket::getEscaped($text,
true) . '%', false);
				foreach($fields as $field) {
					$filters[] = 'vendor.'.$field.' LIKE '.$text;
				}
				break;
			case 'all':
			case 'any':
			default:
				$words = explode( ' ', $text );
				$wordFilters = array();
				$subWordFilters = array();
				foreach($words as $word) {
					$word = $db->Quote('%' . hikamarket::getEscaped($word,
true) . '%', false);
					foreach($fields as $i => $field) {
						$subWordFilters[$i][] = 'vendor.' . $field . ' LIKE
' . $word;
					}
				}
				foreach($subWordFilters as $i => $subWordFilter){
					$wordFilters[$i]= '((' .implode( ($phrase == 'all'
? ') AND (' : ') OR ('),$subWordFilter).
'))';
				}
				$filters[] = '((' . implode( ') OR (', $wordFilters
) . '))';
				break;
		}

		$new_page =
(int)$this->params->get('new_page','1');

		$select = ' vendor.vendor_id AS id, vendor.vendor_name AS title,
vendor.vendor_description AS text, vendor_created as created,
"'.$new_page.'" AS browsernav';
		$count = 0;

		if($add_image) {
			$select .= ', vendor_image ';
		}

		if($limit){
			$query = 'SELECT DISTINCT ' . $select . ' FROM ' .
hikamarket::table('vendor') . ' AS vendor WHERE ' .
implode(' AND ', $filters) . ' ORDER BY ' . $order;
			$db->setQuery($query, 0, $limit);
			$mainRows = $db->loadObjectList('id');
			if(!empty($mainRows)) {
				foreach($mainRows as $k => $main) {
					$rows[$k] = $main;
				}
				$count = count($rows);
			}
		}

		if(!$count)
			return $rows;

		$item_id = $this->params->get('item_id', '');
		$menuClass = hikashop_get('class.menus');
		$Itemid = '';
		if(!empty($item_id))
			$Itemid = '&Itemid=' . $item_id;

		$itemids = array();
		$app = JFactory::getApplication();
		$urlSafe = (method_exists($app,'stringURLSafe'));

		if($add_image) {
			$shopConfig = hikamarket::config(false);
			$uploadFolder =
ltrim(JPath::clean(html_entity_decode($shopConfig->get('uploadfolder'))),DS);
			$uploadFolder = rtrim($uploadFolder,DS).DS;
			$uploadFolder_url = str_replace(DS,'/',$uploadFolder);
			$app = JFactory::getApplication();
			if($app->isAdmin()){
				$uploadFolder_url = '../'.$uploadFolder_url;
			}else{
				$uploadFolder_url =
rtrim(JURI::base(true),'/').'/'.$uploadFolder_url;
			}
		}

		foreach($rows as $k => $row) {
			if($urlSafe) {
				$alias = $app->stringURLSafe(strip_tags($row->title));
			} else {
				$alias = JFilterOutput::stringURLSafe(strip_tags($row->title));
			}

			if($add_image && !empty($row->vendor_image)) {
				$rows[$k]->text = '<img
src="'.$uploadFolder_url.$row->vendor_image.'"
alt=""/>'.$rows[$k]->text;
			}

			$rows[$k]->section = JText::_('HIKA_VENDOR');
			$rows[$k]->href =
'index.php?option=com_hikamarket&ctrl=vendor&task=show&name='
. $alias . '&cid=' . $row->id . $Itemid;
		}

		return $rows;
	}
}
PKo�[����
�
)hikamarket_vendors/hikamarket_vendors.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin"
group="search" method="upgrade">
	<name>Search - HikaMarket Vendors</name>
	<hikainstall ordering="0" enable="1"
report="0" />
	<creationDate>20 juillet 2020</creationDate>
	<version>3.1.1</version>
	<author>Obsidev</author>
	<authorEmail>dev@obsidev.com</authorEmail>
	<authorUrl>http://www.obsidev.com</authorUrl>
	<copyright>Copyright (C) 2012-2020 OBSIDEV SARL - All rights
reserved.</copyright>
	<license>http://www.gnu.org/licenses/gpl-2.0.html
GNU/GPL</license>
	<description>Allows Searching of vendors</description>
	<files>
		<filename
plugin="hikamarket_vendors">hikamarket_vendors.php</filename>
	</files>
	<params addpath="/components/com_hikamarket/params">
		<param name="search_limit" type="text"
size="5" default="50" label="Search Limit"
description="Number of Search items to return" />
		<param name="item_id" type="text"
size="5" default="" label="Itemid for
vendors" description="The id of the menu to append to the URLs so
that the vendor page uses the corresponding HikaMarket options" />
		<param name="new_page" type="radio"
default="1" label="New page" description="Open
links on a new page">
			<option value="2">No</option>
			<option value="1">Yes</option>
		</param>
		<param name="fields" type="vendorsearchfields"
default="vendor_name,vendor_description" label="Fields"
description="Select the fields you want to be searchable" />
		<param name="add_image" type="radio"
default="0" label="Add image" description="Add an
image in the returned content">
			<option value="0">No</option>
			<option value="1">Yes</option>
		</param>
	</params>
	<config>
		<fields name="params"
addfieldpath="/components/com_hikamarket/fields">
			<fieldset name="basic">
				<field name="search_limit" type="text"
label="Search Limit" size="5" default="50"
description="Number of Search items to return" />
				<field name="item_id" type="text"
label="Itemid for vendors" size="5"
default="" description="The id of the menu to append to the
URLs so that the vendor page uses the corresponding HikaMarket
options" />
				<field name="new_page" type="radio"
default="1" label="New page" description="Open
links on a new page">
					<option value="2">No</option>
					<option value="1">Yes</option>
				</field>
				<field name="fields" type="vendorsearchfields"
default="vendor_name,vendor_description" label="Fields"
description="Select the fields you want to be searchable" />
				<field name="add_image" type="radio"
default="0" label="Add image" description="Add an
image in the returned content">
					<option value="0">No</option>
					<option value="1">Yes</option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>
PKo�[�#o,,hikamarket_vendors/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKo�[~׃
##+hikashop_categories/hikashop_categories.phpnu�[���<?php
/**
 * @package	HikaShop for Joomla!
 * @version	4.4.1
 * @author	hikashop.com
 * @copyright	(C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
class plgSearchHikashop_categories extends JPlugin{

	function __construct(&$subject, $config){
		$this->loadLanguage('plg_search_hikashop_categories');
		$this->loadLanguage('plg_search_hikashop_categories_override');
		parent::__construct($subject, $config);
		if(!isset($this->params)){
			$plugin = JPluginHelper::getPlugin('search',
'hikashop_categories');
			$this->params = new JRegistry($plugin->params);
		}
	}

	function onContentSearchAreas(){
		return $this->onSearchAreas();
	}

	function onContentSearch( $text, $phrase='',
$ordering='', $areas=null ){
		return $this->onSearch( $text, $phrase, $ordering, $areas );
	}

	function &onSearchAreas(){
		if(!defined('DS'))
			define('DS', DIRECTORY_SEPARATOR);
		if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php'))
return array();
		$areas = array(
			'categories' =>
JText::_('PRODUCT_CATEGORIES_SEARCH')
		);
		if(1==(int)$this->params->get('manufacturers','1')){
			$areas['manufacturers']=JText::_('MANUFACTURERS_SEARCH');
		}
		return $areas;
	}

	function onSearch( $text, $phrase='', $ordering='',
$areas=null ){
		if(!defined('DS'))
			define('DS', DIRECTORY_SEPARATOR);
		if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php'))
return array();
		$db	= JFactory::getDBO();

		$types=array();
		if (!empty($areas) && is_array( $areas )) {
			$valid = array_keys( $this->onSearchAreas() );
			$use = array_intersect( $areas,  $valid);
			if (!$use) {
				return array();
			}
			if(in_array('categories',$valid)){
				$types[]='\'product\'';
			}
			if(in_array('manufacturers',$valid)){
				$types[]='\'manufacturer\'';
			}
		}else{
			$types[]='\'product\'';
			if(1==(int)$this->params->get('manufacturers','1')){
				$types[]='\'manufacturer\'';
			}
		}

		$limit = $this->params->def( 'search_limit', 50 );

		$text = trim( $text );
		if ( $text == '' ) {
			return array();
		}

		switch($ordering){
			case 'alpha':
				$order = 'a.category_name ASC';
				break;
			case 'newest':
				$order = 'a.category_modified DESC';
				break;
			case 'oldest':
				$order = 'a.category_created ASC';
				break;
			case 'category':
			case 'popular':
			default:
				$order = 'a.category_name DESC';
				break;
		}
		$trans=hikashop_get('helper.translation');
		$multi=$trans->isMulti() && $trans->falang;
		$trans_table = 'falang_content';

		$rows = array();

		$filters = array('a.category_published=1');
		if(count($types)){
			$filters[]='a.category_type IN
('.implode(',',$types).')';
		}else{
			$filters[]='a.category_type NOT IN
(\'status\',\'tax\')';
		}
		hikashop_addACLFilters($filters,'category_access','a');
		$filters2 = array();
		if($multi){
			$registry = JFactory::getConfig();
			$code = $registry->get('language');

			$myLang = $trans->getId($code);
			$filters2[] =
"b.reference_table='hikashop_category'";
			$filters2[] = "b.published=1";
			$filters2[] = 'b.language_id='.$myLang;
		}
		switch($phrase){
			case 'exact':
				$text		= $db->Quote( '%'.hikashop_getEscaped( $text, true
).'%', false );
				$filters1 = array();
				$filters1[] = "a.category_name LIKE ".$text;
				$filters1[] = "a.category_description LIKE ".$text;
				if($multi){
					$filters2[] = "b.value LIKE ".$text;
				}
				break;
			case 'all':
			case 'any':
			default:
				$words = explode( ' ', $text );
				$wordFilters = array();
				$subWordFilters1 = array();
				$subWordFilters2 = array();
				$wordFilters2 = array();
				foreach ($words as $word) {
					$word		= $db->Quote( '%'.hikashop_getEscaped( $word, true
).'%', false );
					$subWordFilters1[] 	= "a.category_name LIKE ".$word;
					$subWordFilters2[] 	= "a.category_description LIKE ".$word;
					if($multi){
						$wordFilters2[] = "b.value LIKE ".$word;
					}
				}
				$wordFilters[0]= '((' .implode( ($phrase == 'all' ?
') AND (' : ') OR ('),$subWordFilters1).
'))';
				$wordFilters[1]= '((' .implode( ($phrase == 'all' ?
') AND (' : ') OR ('),$subWordFilters2).
'))';
				$filters[] = '((' . implode( ') OR (', $wordFilters
) . '))';
				if($multi){
					$filters2[] = '((' . implode( ($phrase == 'all' ?
') AND (' : ') OR ('), $wordFilters2 ) .
'))';
				}
				break;
		}

		$new_page =
(int)$this->params->get('new_page','1');
		$select = ' a.category_type AS section, a.category_id AS id,
a.category_name AS title, a.category_created AS created ,
a.category_description AS text, "'.$new_page.'" AS
browsernav, a.category_canonical, a.category_alias';
		$count = 0;
		if($multi && !empty($myLang)){
			$query = ' SELECT DISTINCT '.$select.' FROM
'.hikashop_table($trans_table,false) . ' AS b LEFT JOIN
'.hikashop_table('category').' AS a ON
b.reference_id=a.category_id WHERE '.implode(' AND
',$filters2).' ORDER BY '.$order;
			$db->setQuery($query, 0, $limit);
			$rows = $db->loadObjectList("id");
			$count = count($rows);
			if($count){
				$limit = $limit-$count;

				$ids = array_keys($rows);
				hikashop_toInteger($ids);
				$filters[]='a.category_id NOT IN
('.implode(',',$ids).')';
			}
		}

		if($limit){
			$filters = implode(' AND ',$filters);
			if(isset($filters1)){
				$filters = '('.$filters.') AND ('.implode(' OR
',$filters1).')';
			}
			$query = ' SELECT '.$select.' FROM
'.hikashop_table('category') . ' AS a WHERE
'.$filters.' ORDER BY '.$order;
			$db->setQuery( $query, 0, $limit );
			$mainRows = $db->loadObjectList("id");
			if(!empty($mainRows)){
				foreach($mainRows as $k => $main){
					$rows[$k]=$main;
				}
				$count = count( $rows );
			}
		}
		if($count){

			if($multi && !empty($myLang)){
				$query = ' SELECT * FROM '.hikashop_table($trans_table,false)
. ' WHERE reference_table=\'hikashop_category\' AND
language_id=\''.$myLang.'\' AND published=1 AND
reference_id IN
('.implode(',',array_keys($rows)).')';
				$db->setQuery($query);
				$trans = $db->loadObjectList();
				foreach($trans as $item){
					foreach($rows as $key => $row){
						if($row->id==$item->reference_id){
							if($item->reference_field=='category_name'){
								$row->title=$item->value;
							}elseif($item->reference_field=='category_description'){
								$row->text=$item->value;
							}
							break;
						}
					}
				}
			}
			$item_id = $this->params->get('item_id','');
			$menuClass = hikashop_get('class.menus');
			if(!empty($item_id)){
				$item_id =
$menuClass->loadAMenuItemId('category','listing',$item_id);
			}
			$Itemid="";
			if(!empty($item_id)){
				$Itemid='&Itemid='.$item_id;
			}
			$manu_item_id =
$this->params->get('manu_item_id','');
			if(!empty($manu_item_id)){
				$manu_item_id =
$menuClass->loadAMenuItemId('manufacturer','listing',$manu_item_id);
			}
			$manu_Itemid='';
			if(!empty($manu_item_id)){
				$manu_Itemid='&Itemid='.$manu_item_id;
			}
			$itemids=array();

			$categoryClass = hikashop_get('class.category');
			foreach ( $rows as $k => $row ) {
				$row->category_name = $row->title;
				$row->category_id = $row->id;
				$categoryClass->addAlias($row);
				$row->title = hikashop_translate($row->title);

				if(!empty($row->category_canonical)){
					$rows[$k]->href = $row->category_canonical;
				}else{
					if(empty($manu_item_id) && !empty($row->id) &&
$row->section=='manufacturer'){
						if(!isset($itemids[$row->id])) $itemids[$row->id] =
$menuClass->getItemidFromCategory($row->id,$row->section);
						$manu_item_id = $itemids[$row->id];
						if(!empty($manu_item_id)){
							$manu_Itemid='&Itemid='.$manu_item_id;
						}
						if(!$this->params->get('manu_item_id',''))
$manu_item_id = '';
					}elseif(empty($item_id) && !empty($row->id) &&
$row->section!='manufacturer'){
						if(!isset($itemids[$row->id])) $itemids[$row->id] =
$menuClass->getItemidFromCategory($row->id,'category');
						$item_id = $itemids[$row->id];
						if(!empty($item_id)){
							$Itemid='&Itemid='.$item_id;
						}
						if(!$this->params->get('item_id',''))
$item_id = '';
					}

					if($row->section=='manufacturer'){
						$rows[$k]->href =
'index.php?option=com_hikashop&ctrl=category&task=listing&name='.$row->alias.'&cid='.$row->id.$manu_Itemid;
					}else{
						$rows[$k]->href =
'index.php?option=com_hikashop&ctrl=category&task=listing&name='.$row->alias.'&cid='.$row->id.$Itemid;
					}
				}

				if($row->section=='manufacturer'){
					$rows[$k]->section 	= JText::_( 'MANUFACTURERS' );
				}else{
					$rows[$k]->section 	= JText::_( 'PRODUCT_CATEGORY' );
				}
			}
		}
		return $rows;
	}
}
PKo�[�w�ת
�
+hikashop_categories/hikashop_categories.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin"
group="search" method="upgrade">
	<name>Search - Hikashop Categories/Manufacturers</name>
	<author>Hikari Software</author>
	<creationDate>12 février 2021</creationDate>
	<version>4.4.1</version>
	<copyright>(C) 2010-2021 HIKARI SOFTWARE. All rights
reserved.</copyright>
	<license>http://www.gnu.org/licenses/gpl-2.0.html
GNU/GPL</license>
	<authorEmail>enquiry@hikashop.com</authorEmail>
	<authorUrl>www.hikashop.com</authorUrl>
	<description>Allows Searching of Products Categories and
manufacturers</description>
	<files>
		<filename
plugin="hikashop_categories">hikashop_categories.php</filename>
	</files>
	<params>
		<param name="search_limit" type="text"
size="5" default="50" label="SEARCH_LIMIT"
description="HIKA_SEARCH_LIMIT"/>
		<param name="item_id" type="text"
size="5" default=""
label="HIKA_ITEMID_FOR_CATEGORIES"
description="ITEMID_FOR_CATEGORIES"/>
		<param name="manufacturers" type="radio"
default="1" label="MANUFACTURERS"
description="SEARCH_MANUFACTURERS">
			<option value="2">HIKASHOP_NO</option>
			<option value="1">HIKASHOP_YES</option>
		</param>
		<param name="manu_item_id" type="text"
size="5" default=""
label="HIKA_ITEMID_FOR_MANUFACTURERS"
description="ITEMID_FOR_MANUFACTURERS"/>
		<param name="new_page" type="radio"
default="1" label="NEW_PAGE"
description="HIKA_NEW_PAGE">
			<option value="2">HIKASHOP_NO</option>
			<option value="1">HIKASHOP_YES</option>
		</param>
	</params>
	<config>
		<fields name="params"
addfieldpath="/components/com_hikashop/fields">
			<fieldset name="basic">
				<field
					name="search_limit"
					type="text"
					label="SEARCH_LIMIT"
					size="5"
					default="50"
					description="HIKA_SEARCH_LIMIT" />
				<field
					name="item_id"
					type="text"
					label="HIKA_ITEMID_FOR_CATEGORIES"
					size="5"
					default=""
					description="ITEMID_FOR_CATEGORIES" />
				<field name="manufacturers" type="radio"
default="1" label="MANUFACTURERS"
description="SEARCH_MANUFACTURERS" class="btn-group
btn-group-yesno">
					<option value="2">HIKASHOP_NO</option>
					<option value="1">HIKASHOP_YES</option>
				</field>
				<field
					name="manu_item_id"
					type="text"
					label="HIKA_ITEMID_FOR_MANUFACTURERS"
					size="5"
					default=""
					description="ITEMID_FOR_MANUFACTURERS" />
				<field
					name="new_page"
					type="radio"
					default="1"
					label="NEW_PAGE"
					description="HIKA_NEW_PAGE"
					class="btn-group btn-group-yesno">
					<option value="2">HIKASHOP_NO</option>
					<option value="1">HIKASHOP_YES</option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>
PKo�[�#o,,hikashop_categories/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKo�[���0�0'hikashop_products/hikashop_products.phpnu�[���<?php
/**
 * @package	HikaShop for Joomla!
 * @version	4.4.1
 * @author	hikashop.com
 * @copyright	(C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
class plgSearchHikashop_products extends JPlugin{

	function __construct(&$subject, $config){
		$this->loadLanguage('plg_search_hikashop_products');
		$this->loadLanguage('plg_search_hikashop_products_override');
		parent::__construct($subject, $config);
		if(!isset($this->params)){
			$plugin = JPluginHelper::getPlugin('search',
'hikashop_products');
			$this->params = new JRegistry(@$plugin->params);
		}
	}

	function onContentSearchAreas(){
		return $this->onSearchAreas();
	}
	function onContentSearch( $text, $phrase='',
$ordering='', $areas=null ){
		return $this->onSearch( $text, $phrase, $ordering, $areas );
	}

	function &onSearchAreas(){
		if(!defined('DS'))
			define('DS', DIRECTORY_SEPARATOR);
		if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php'))
return array();
		$areas = array(
			'products' => JText::_('PRODUCTS_SEARCH')
		);
		return $areas;
	}

	function onSearch( $text, $phrase='', $ordering='',
$areas=null ){
		if(!defined('DS'))
			define('DS', DIRECTORY_SEPARATOR);
		if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php'))
return array();
		$db		= JFactory::getDBO();
		if (is_array( $areas )) {
			if (!array_intersect( $areas, array_keys( $this->onSearchAreas() ) ))
{
				return array();
			}
		}

		$limit = $this->params->def( 'search_limit', 50 );

		$text = trim( $text );
		if ( $text == '' ) {
			return array();
		}

		switch($ordering){
			case 'alpha':
				$order = 'a.product_name ASC';
				break;
			case 'newest':
				$order = 'a.product_modified DESC';
				break;
			case 'oldest':
				$order = 'a.product_created ASC';
				break;
			case 'popular':
				$order = 'a.product_hit DESC';
				break;
			case 'category':
			default:
				$order = 'a.product_name DESC';
				break;
		}
		$trans=hikashop_get('helper.translation');
		$multi=$trans->isMulti() && $trans->falang;
		$trans_table = 'falang_content';

		$rows = array();

		$filters = array('a.product_published=1');
		$filters2 = array('a.product_published=1');

		$variants =
(int)$this->params->get('variants','0');
		if(!$variants){
			$filters[]='a.product_type=\'main\'';
			$filters2[]='a.product_type=\'main\'';
		}
		$out_of_stock =
(int)$this->params->get('out_of_stock_display','1');
		if(!$out_of_stock){
			$filters[]='a.product_quantity!=0';
			$filters2[]='a.product_quantity!=0';
		}

		hikashop_addACLFilters($filters,'product_access','a');
		$leftjoin='';

		$catFilters =
array('category_published=1','category_type=\'product\'');
		hikashop_addACLFilters($catFilters,'category_access');
		$db->setQuery('SELECT category_id FROM
'.hikashop_table('category').' WHERE
'.implode(' AND ',$catFilters));
		$cats = $db->loadColumn();

		if(!empty($cats)){
			$filters[]='b.category_id IN
('.implode(',',$cats).')';
		}

		if($variants){
			$leftjoin=' INNER JOIN
'.hikashop_table('product_category').' AS b ON
a.product_parent_id=b.product_id OR a.product_id=b.product_id';
		}else{
			$leftjoin=' INNER JOIN
'.hikashop_table('product_category').' AS b ON
a.product_id=b.product_id';
		}


		if($multi){
			$registry = JFactory::getConfig();
			$code = $registry->get('language');

			$lg = $trans->getId($code);
			$filters2[] =
"b.reference_table='hikashop_product'";
			$filters2[] = "b.published=1";
			$filters2[] = 'b.language_id='.$lg;
		}

		$fields = $this->params->get('fields','');
		if(empty($fields)){
			$fields =
array('product_name','product_description');
		}elseif(!is_array($fields)){
			$fields = explode(',',$fields);
		}

		if($multi) {
			$reference_fields = array();
			foreach($fields as $f){
				$reference_fields[] = $db->Quote($f);
			}
		}

		switch($phrase){
			case 'exact':
				$text		= $db->Quote( '%'.hikashop_getEscaped( $text, true
).'%', false );
				$filters1 = array();
				foreach($fields as $f){
					$filters1[] = "a.".$f." LIKE ".$text;
				}

				if($multi){
					$filters2[] = "b.reference_field IN (" .
implode(',', $reference_fields) . ") AND b.value LIKE "
. $text;
				}
				break;
			case 'all':
			case 'any':
			default:
				$words = explode( ' ', $text );
				$wordFilters = array();
				$subWordFiltersX = array();
				$wordFilters2 = array();
				foreach ($words as $word) {
					$word		= $db->Quote( '%'.hikashop_getEscaped( $word, true
).'%', false );
					foreach($fields as $i => $f){
						$subWordFiltersX[$i][] = "a.".$f." LIKE ".$word;
					}
					if($multi){
						$wordFilters2[] = "b.reference_field IN (" .
implode(',', $reference_fields) . ") AND b.value LIKE
".$word;
					}
				}
				foreach($subWordFiltersX as $i => $subWordFilters){
					$wordFilters[$i]= '((' .implode( ($phrase == 'all'
? ') AND (' : ') OR ('),$subWordFilters).
'))';
				}
				$filters[] = '((' . implode( ') OR (', $wordFilters
) . '))';
				if($multi){
					$filters2[] = '((' . implode( ($phrase == 'all' ?
') AND (' : ') OR ('), $wordFilters2 ) .
'))';
				}
				break;
		}

		$new_page =
(int)$this->params->get('new_page','1');

		$select = ' a.product_id, a.product_id AS id, a.product_name,
a.product_alias, a.product_canonical, a.product_created AS created ,
a.product_description, "'.$new_page.'" AS
browsernav';
		if($variants){
			$select.=', a.product_type, a.product_parent_id';
		}
		$count = 0;
		if($multi && !empty($lg)){
			$db->setQuery('SET SQL_BIG_SELECTS=1');
			$db->execute();
			$query = ' SELECT DISTINCT '.$select.' FROM
'.hikashop_table($trans_table,false) . ' AS b LEFT JOIN
'.hikashop_table('product').' AS a ON
b.reference_id=a.product_id WHERE '.implode(' AND
',$filters2).' ORDER BY '.$order;
			$db->setQuery($query, 0, $limit);
			$rows = $db->loadObjectList("id");
			$count = count($rows);
			if($count){
				$limit = $limit-$count;
				$ids = array_keys($rows);
				hikashop_toInteger($ids);
				$filters[]='a.product_id NOT IN ('.implode(',',
$ids).')';
			}
		}

		if($limit){
			if(!empty($leftjoin)){
				$select.=', b.category_id as category_id';
			}
			$db->setQuery('SET SQL_BIG_SELECTS=1');
			$db->execute();
			$filters = implode(' AND ',$filters);
			if(isset($filters1)){
				$filters = '('.$filters.') AND ('.implode(' OR
',$filters1).')';
			}
			$query = ' SELECT DISTINCT '.$select.' FROM
'.hikashop_table('product') . ' AS a
'.$leftjoin.' WHERE '.$filters.' GROUP BY
(a.product_id) ORDER BY '.$order;
			$db->setQuery( $query, 0, $limit );
			$mainRows = $db->loadObjectList("id");
			if(!empty($mainRows)){
				foreach($mainRows as $k => $main){
					$rows[(int)$k] = $main;
				}
				$count = count( $rows );
			}
		}
		if($count){

			if($multi && !empty($lg)){
				$ids = array_keys($rows);
				hikashop_toInteger($ids);
				$query = ' SELECT * FROM '.hikashop_table($trans_table,false)
. ' WHERE reference_table=\'hikashop_product\' AND
language_id=\''.$lg.'\' AND published=1 AND
reference_id IN ('.implode(',', $ids).')';
				if($multi){
					$query .= " AND reference_field IN (" .
implode(',', $reference_fields) . ")";
				}
				$db->setQuery($query);
				$trans = $db->loadObjectList();
				foreach($trans as $item){
					foreach($rows as $key => $row){
						if($row->id==$item->reference_id){
							if($item->reference_field=='product_name'){
								$row->product_name=$item->value;
								break;
							}elseif($item->reference_field=='product_description'){
								$row->product_description=$item->value;
								break;
							}else{
								$row->product_description .= ' ' . $item->value;
							}
						}
					}
				}
			}
			$parent = '';
			$item_id = $this->params->get('item_id','');
			$menuClass = hikashop_get('class.menus');
			$config =& hikashop_config();
			$pathway_sef_name =
$config->get('pathway_sef_name','category_pathway');
			$menus=array();
			$Itemid='';
			if(!empty($item_id)){
				$Itemid='&Itemid='.$item_id;
				if($this->params->get('full_path',1)){
					$menuData = $menus[$item_id] = $menuClass->get($item_id);
					if(!empty($menuData->hikashop_params['selectparentlisting'])){
						$parent =
'&'.$pathway_sef_name.'='.(int)$menuData->hikashop_params['selectparentlisting'];
					}
				}
			}
			$itemids=array();
			$app= JFactory::getApplication();
			$class = hikashop_get('class.product');
			$ids = array();
			foreach ( $rows as $k => $row ) {
				$ids[(int)$row->id]=(int)$row->id;
				if(!empty($row->category_id)){
					if(empty($item_id)){
						if(!isset($itemids[$row->category_id]))
$itemids[$row->category_id] =
$menuClass->getItemidFromCategory($row->category_id);
						$item_id = $itemids[$row->category_id];
					}
					if(!empty($item_id)){
						$Itemid='&Itemid='.$item_id;
					}
					if($this->params->get('full_path',1)){
						$parent =
'&'.$pathway_sef_name.'='.(int)$row->category_id;
					}
					if(!$this->params->get('item_id',''))
$item_id = '';
				}
				$class->addAlias($row);
				$rows[$k]->title=hikashop_translate($row->product_name);
				$rows[$k]->text=hikashop_translate($row->product_description);
				if($variants && $row->product_type=='variant'){
					$ids[(int)$row->product_parent_id]=(int)$row->product_parent_id;
					static $mains = array();
					if(!isset($mains[$row->product_parent_id])){
						$mains[$row->product_parent_id] =
$class->get((int)$row->product_parent_id);
						$class->addAlias($mains[$row->product_parent_id]);
					}

					if(isset($mains[$row->product_parent_id]) &&
empty($mains[$row->product_parent_id]->product_published)) {
						unset($rows[$k]);
						continue;
					}

					$db = JFactory::getDBO();
					$db->setQuery('SELECT * FROM
'.hikashop_table('variant').' AS a LEFT JOIN
'.hikashop_table('characteristic') .' AS b ON
a.variant_characteristic_id=b.characteristic_id WHERE
a.variant_product_id='.(int)$row->id.' ORDER BY
a.ordering');
					$row->characteristics = $db->loadObjectList();
					$class->checkVariant($row,$mains[$row->product_parent_id]);
					if(empty($row->title)){
						$row->title =
strip_tags(hikashop_translate($row->product_name));
					}
					if(empty($row->text)){
						$row->text =
hikashop_translate($mains[$row->product_parent_id]->product_description);
					}
				}
				if(empty($row->product_canonical)){
					$rows[$k]->href =
JRoute::_('index.php?option=com_hikashop&ctrl=product&task=show&name='.$row->alias.'&cid='.$row->id.$Itemid.$parent);
				}else{
					$rows[$k]->href = $row->product_canonical;
				}
				$rows[$k]->href = hikashop_cleanURL($rows[$k]->href);

				$rows[$k]->section 	= JText::_( 'PRODUCT' );
			}

			if(!empty($ids)){
				$imageHelper = hikashop_get('helper.image');
				$height =
(int)$config->get('thumbnail_y','100');
				$width =
(int)$config->get('thumbnail_x','100');
				$image_options = array('default' =>
true,'forcesize'=>$config->get('image_force_size',true),'scale'=>$config->get('image_scale_mode','inside'));
				$db = JFactory::getDBO();
				$queryImage = 'SELECT * FROM
'.hikashop_table('file').' WHERE file_ref_id IN
('.implode(',',$ids).') AND
file_type=\'product\' ORDER BY file_ref_id ASC, file_ordering
DESC, file_id ASC';
				$db->setQuery($queryImage);
				$images = $db->loadObjectList('file_ref_id');
				foreach($rows as $k => $row){
					foreach($images as $k2 => $image){
						if($k==$k2){
							$result = $imageHelper->getThumbnail(@$image->file_path,
array('width' => $width, 'height' => $height),
$image_options);
							if($result->success){
								$rows[$k]->image = $result->url;
							}
							break;
						}
					}

					if(!empty($rows[$k]->image))
						continue;

					if(!$variants)
						continue;

					foreach($images as $k2 => $image){
						if($row->product_parent_id==$k2){
							$result = $imageHelper->getThumbnail(@$image->file_path,
array('width' => $width, 'height' => $height),
$image_options);
							if($result->success){
								$rows[$k]->image = $result->url;
							}
							break;
						}
					}
				}
			}

		}
		return $rows;
	}
}
PKo�[�&��'hikashop_products/hikashop_products.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin"
group="search" method="upgrade">
	<name>Search - Hikashop Products</name>
	<author>Hikari Software</author>
	<creationDate>12 février 2021</creationDate>
	<version>4.4.1</version>
	<copyright>(C) 2010-2021 HIKARI SOFTWARE. All rights
reserved.</copyright>
	<license>http://www.gnu.org/licenses/gpl-2.0.html
GNU/GPL</license>
	<authorEmail>enquiry@hikashop.com</authorEmail>
	<authorUrl>www.hikashop.com</authorUrl>
	<description>Allows Searching of Products</description>
	<files>
		<filename
plugin="hikashop_products">hikashop_products.php</filename>
	</files>
	<params addpath="/components/com_hikashop/params">
		<param name="search_limit" type="text"
size="5" default="50" label="SEARCH_LIMIT"
description="HIKA_SEARCH_LIMIT"/>
		<param name="item_id" type="text"
size="5" default="" label="ITEMID"
description="HIKA_ITEMID"/>
		<param name="full_path" type="radio"
default="1" label="FULL_BREADCRUMB_PATH"
description="HIKA_FULL_BREADCRUMB_PATH">
			<option value="0">HIKASHOP_NO</option>
			<option value="1">HIKASHOP_YES</option>
		</param>
		<param name="out_of_stock_display" type="radio"
default="1" label="OUT_OF_STOCK_PRODUCTS"
description="HIKA_OUT_OF_STOCK_PRODUCTS">
			<option value="0">HIKASHOP_NO</option>
			<option value="1">HIKASHOP_YES</option>
		</param>
		<param name="new_page" type="radio"
default="1" label="NEW_PAGE"
description="HIKA_NEW_PAGE">
			<option value="2">HIKASHOP_NO</option>
			<option value="1">HIKASHOP_YES</option>
		</param>
		<param name="variants" type="radio"
default="0" label="HIKA_SEARCH_VARIANTS"
description="HIKA_SEARCH_VARIANTS">
			<option value="0">HIKASHOP_NO</option>
			<option value="1">HIKASHOP_YES</option>
		</param>
		<param name="fields" type="searchfields"
default="product_name,product_description"
label="HIKASHOP_CHECKOUT_FIELDS"
description="HIKA_FIELDS" />
	</params>
	<config>
		<fields name="params"
addfieldpath="/components/com_hikashop/fields">
			<fieldset name="basic">
				<field
					name="search_limit"
					type="text"
					label="SEARCH_LIMIT"
					size="5"
					default="50"
					description="HIKA_SEARCH_LIMIT" />
				<field
					name="item_id"
					type="text"
					label="ITEMID"
					size="5"
					default=""
					description="HIKA_ITEMID" />
				<field
					name="full_path"
					type="radio"
					default="1"
					label="FULL_BREADCRUMB_PATH"
					description="HIKA_FULL_BREADCRUMB_PATH"
					class="btn-group btn-group-yesno">
					<option value="0">HIKASHOP_NO</option>
					<option value="1">HIKASHOP_YES</option>
				</field>
				<field
					name="out_of_stock_display"
					type="radio"
					default="1"
					label="OUT_OF_STOCK_PRODUCTS"
					description="HIKA_OUT_OF_STOCK_PRODUCTS"
					class="btn-group btn-group-yesno">
					<option value="0">HIKASHOP_NO</option>
					<option value="1">HIKASHOP_YES</option>
				</field>
				<field
					name="new_page"
					type="radio"
					default="1"
					label="NEW_PAGE"
					description="HIKA_NEW_PAGE"
					class="btn-group btn-group-yesno">
					<option value="2">HIKASHOP_NO</option>
					<option value="1">HIKASHOP_YES</option>
				</field>
				<field name="variants" type="radio"
default="0" label="HIKA_SEARCH_VARIANTS"
description="HIKA_SEARCH_VARIANTS" class="btn-group
btn-group-yesno">
					<option value="0">HIKASHOP_NO</option>
					<option value="1">HIKASHOP_YES</option>
				</field>
				<field name="fields" type="searchfields"
default="product_name,product_description"
label="HIKASHOP_CHECKOUT_FIELDS"
description="HIKA_FIELDS" />
			</fieldset>
		</fields>
	</config>
</extension>
PKo�[�#o,,hikashop_products/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKo�[�|5-newsfeeds/newsfeeds.phpnu�[���<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Search.newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Newsfeeds search plugin.
 *
 * @since  1.6
 */
class PlgSearchNewsfeeds extends JPlugin
{
	/**
	 * Load the language file on instantiation.
	 *
	 * @var    boolean
	 * @since  3.1
	 */
	protected $autoloadLanguage = true;

	/**
	 * Determine areas searchable by this plugin.
	 *
	 * @return  array  An array of search areas.
	 *
	 * @since   1.6
	 */
	public function onContentSearchAreas()
	{
		static $areas = array(
			'newsfeeds' => 'PLG_SEARCH_NEWSFEEDS_NEWSFEEDS'
		);

		return $areas;
	}

	/**
	 * Search content (newsfeeds).
	 *
	 * The SQL must return the following fields that are used in a common
display
	 * routine: href, title, section, created, text, browsernav.
	 *
	 * @param   string  $text      Target search string.
	 * @param   string  $phrase    Matching option (possible values:
exact|any|all).  Default is "any".
	 * @param   string  $ordering  Ordering option (possible values:
newest|oldest|popular|alpha|category).  Default is "newest".
	 * @param   mixed   $areas     An array if the search it to be restricted
to areas or null to search all areas.
	 *
	 * @return  array  Search results.
	 *
	 * @since   1.6
	 */
	public function onContentSearch($text, $phrase = '', $ordering =
'', $areas = null)
	{
		$db = JFactory::getDbo();
		$app = JFactory::getApplication();
		$user = JFactory::getUser();
		$groups = implode(',', $user->getAuthorisedViewLevels());

		if (is_array($areas) && !array_intersect($areas,
array_keys($this->onContentSearchAreas())))
		{
			return array();
		}

		$sContent = $this->params->get('search_content', 1);
		$sArchived = $this->params->get('search_archived', 1);
		$limit = $this->params->def('search_limit', 50);
		$state = array();

		if ($sContent)
		{
			$state[] = 1;
		}

		if ($sArchived)
		{
			$state[] = 2;
		}

		if (empty($state))
		{
			return array();
		}

		$text = trim($text);

		if ($text === '')
		{
			return array();
		}

		switch ($phrase)
		{
			case 'exact':
				$text = $db->quote('%' . $db->escape($text, true) .
'%', false);
				$wheres2 = array();
				$wheres2[] = 'a.name LIKE ' . $text;
				$wheres2[] = 'a.link LIKE ' . $text;
				$where = '(' . implode(') OR (', $wheres2) .
')';
				break;

			case 'all':
			case 'any':
			default:
				$words = explode(' ', $text);
				$wheres = array();

				foreach ($words as $word)
				{
					$word = $db->quote('%' . $db->escape($word, true) .
'%', false);
					$wheres2 = array();
					$wheres2[] = 'a.name LIKE ' . $word;
					$wheres2[] = 'a.link LIKE ' . $word;
					$wheres[] = implode(' OR ', $wheres2);
				}

				$where = '(' . implode(($phrase === 'all' ? ')
AND (' : ') OR ('), $wheres) . ')';
				break;
		}

		switch ($ordering)
		{
			case 'alpha':
				$order = 'a.name ASC';
				break;

			case 'category':
				$order = 'c.title ASC, a.name ASC';
				break;

			case 'oldest':
			case 'popular':
			case 'newest':
			default:
				$order = 'a.name ASC';
		}

		$searchNewsfeeds = JText::_('PLG_SEARCH_NEWSFEEDS_NEWSFEEDS');

		$query = $db->getQuery(true);

		// SQLSRV changes.
		$case_when  = ' CASE WHEN ';
		$case_when .= $query->charLength('a.alias', '!=',
'0');
		$case_when .= ' THEN ';
		$a_id       = $query->castAsChar('a.id');
		$case_when .= $query->concatenate(array($a_id, 'a.alias'),
':');
		$case_when .= ' ELSE ';
		$case_when .= $a_id . ' END as slug';

		$case_when1  = ' CASE WHEN ';
		$case_when1 .= $query->charLength('c.alias', '!=',
'0');
		$case_when1 .= ' THEN ';
		$c_id        = $query->castAsChar('c.id');
		$case_when1 .= $query->concatenate(array($c_id, 'c.alias'),
':');
		$case_when1 .= ' ELSE ';
		$case_when1 .= $c_id . ' END as catslug';

		$query->select('a.name AS title, \'\' AS created,
a.link AS text, ' . $case_when . ',' . $case_when1)
			->select($query->concatenate(array($db->quote($searchNewsfeeds),
'c.title'), ' / ') . ' AS section')
			->select('\'1\' AS browsernav')
			->from('#__newsfeeds AS a')
			->join('INNER', '#__categories as c ON c.id =
a.catid')
			->where('(' . $where . ') AND a.published IN (' .
implode(',', $state) . ') AND c.published = 1 AND c.access
IN (' . $groups . ')')
			->order($order);

		// Filter by language.
		if ($app->isClient('site') &&
JLanguageMultilang::isEnabled())
		{
			$tag = JFactory::getLanguage()->getTag();
			$query->where('a.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')')
				->where('c.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')');
		}

		$db->setQuery($query, 0, $limit);

		try
		{
			$rows = $db->loadObjectList();
		}
		catch (RuntimeException $e)
		{
			$rows = array();
			JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'),
'error');
		}

		if ($rows)
		{
			foreach ($rows as $key => $row)
			{
				$rows[$key]->href =
'index.php?option=com_newsfeeds&view=newsfeed&catid=' .
$row->catslug . '&id=' . $row->slug;
			}
		}

		return $rows;
	}
}
PKo�[.rrm��newsfeeds/newsfeeds.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin"
group="search" method="upgrade">
	<name>plg_search_newsfeeds</name>
	<author>Joomla! Project</author>
	<creationDate>November 2005</creationDate>
	<copyright>Copyright (C) 2005 - 2020 Open Source Matters. All rights
reserved.</copyright>
	<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
	<authorEmail>admin@joomla.org</authorEmail>
	<authorUrl>www.joomla.org</authorUrl>
	<version>3.0.0</version>
	<description>PLG_SEARCH_NEWSFEEDS_XML_DESCRIPTION</description>
	<files>
		<filename
plugin="newsfeeds">newsfeeds.php</filename>
	</files>
	<languages>
		<language
tag="en-GB">en-GB.plg_search_newsfeeds.ini</language>
		<language
tag="en-GB">en-GB.plg_search_newsfeeds.sys.ini</language>
	</languages>
	<config>
		<fields name="params">
			<fieldset name="basic">
				<field
					name="search_limit"
					type="number"
					label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL"
					description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC"
					default="50"
					filter="integer"
					size="5"
				/>

				<field
					name="search_content"
					type="radio"
					label="JFIELD_PLG_SEARCH_ALL_LABEL"
					description="JFIELD_PLG_SEARCH_ALL_DESC"
					class="btn-group btn-group-yesno"
					default="0"
					filter="integer"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>

				<field
					name="search_archived"
					type="radio"
					label="JFIELD_PLG_SEARCH_ARCHIVED_LABEL"
					description="JFIELD_PLG_SEARCH_ARCHIVED_DESC"
					class="btn-group btn-group-yesno"
					default="0"
					filter="integer"
					>
					<option value="1">JON</option>
					<option value="0">JOFF</option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>
PKo�[�#o,,reservation_search/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKo�[Cg
��Ireservation_search/language/en-GB/en-GB.plg_search_reservation_search.ininu�[���PLG_SEARCH_RESERVATION_SEARCH="Search
- Reservation_search"
PLG_SEARCH_RESERVATION_SEARCH_DESCRIPTION="reservation search"
PLG_SEARCH_RESERVATION_SEARCH_XML_DESCRIPTION="<h1>Search -
Reservation_search (v.1.0.0)</h1> <div style='clear:
both;'></div><p>reservation
search</p><p>Created by <a
href='http://farhad.com' target='_blank'>farhad
shahbazi</a><br /><small>Development started 15th March,
2023</small></p>"PKo�[Cg
��Mreservation_search/language/en-GB/en-GB.plg_search_reservation_search.sys.ininu�[���PLG_SEARCH_RESERVATION_SEARCH="Search
- Reservation_search"
PLG_SEARCH_RESERVATION_SEARCH_DESCRIPTION="reservation search"
PLG_SEARCH_RESERVATION_SEARCH_XML_DESCRIPTION="<h1>Search -
Reservation_search (v.1.0.0)</h1> <div style='clear:
both;'></div><p>reservation
search</p><p>Created by <a
href='http://farhad.com' target='_blank'>farhad
shahbazi</a><br /><small>Development started 15th March,
2023</small></p>"PKo�[�#o,,,reservation_search/language/en-GB/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKo�[�#o,,&reservation_search/language/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKo�[k�0>>)reservation_search/reservation_search.phpnu�[���<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			28th March, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		reservation_search.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');


/***[JCBGUI.class_extends.head.1.$$$$]***/

use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Plugin\CMSPlugin;
/***[/JCBGUI$$$$]***/


/***[JCBGUI.class_extends.comment.1.$$$$]***/
/**
 * Search - Reservation_search plugin.
 *
 * @package   Reservation_search
 * @since     1.0.0
 *//***[/JCBGUI$$$$]***/

class PlgSearchReservation_search extends CMSPlugin
{

/***[JCBGUI.joomla_plugin.main_class_code.68.$$$$]***/
  public function __construct(&$subject, $config)
  {
    parent::__construct($subject, $config);
    $this->loadLanguage();
  }

function onContentSearchAreas()
{
    return array('reservation' =>
JText::_("JRESERVATION")); // translate_need
}

function onContentSearch($text, $phrase='',
$ordering='', $areas=null)
{
    $db     = JFactory::getDBO();
    $like= $db->quote('%'.str_replace('
','%',trim($text)).'%');

    $query = $db->getQuery(true);
    $query
        ->select('u.name, ca.title, c.account, c.id as c_d_id,
c.published')
        ->from($db->quoteName('#__reservation_consultant',
'c'))
        ->join('INNER',
$db->quoteName('#__users', 'u') . ' ON ' .
$db->quoteName('c.userid') . ' = ' .
$db->quoteName('u.id'))
        ->join('INNER',
$db->quoteName('#__categories', 'ca') . ' ON
' . $db->quoteName('c.catid') . ' = ' .
$db->quoteName('ca.id'))
        ->where($db->quoteName('u.name') . ' LIKE
' . $like)
        ->orwhere($db->quoteName('ca.title') . ' LIKE
' . $like);
    $db->setQuery($query);
    $rows = $db->loadAssocList();

    $rows_result = array ();
    foreach($rows as $key => $row) {
        if($row['published'] == 1)
        {
            $obj = new JObject ();
            $obj->title= $row['name'];
            $obj->section = $row['title'];
            $obj->created = "";
            $obj->browsernav = '1'; // 1 = new window, 2 =
same window
            if ($row['account']== 'consultant')
            {
                $obj->href =
JRoute::_("/index.php?option=com_reservation&view=consultantitem&id={$row['c_d_id']}",
true);
                $obj->text = "text";
            }
            else if ($row['account']== 'doctor')
            {
                $obj->href =
JRoute::_('index.php?option=com_moojla&view=coursedetail&id='.$row['remoteid'],
true);
                $obj->text = "";
            }
            else if ($row['account']== 'both')
            {
                $obj->href =
JRoute::_("/index.php?option=com_reservation&view=consultantitem&id={$row['c_d_id']}",
true);
                $obj->text = "";
            }
            $rows_result[] = $obj;
        }
    }
//    echo '<pre>';
//    var_dump($rows);
//    echo '</pre>';
//    exit();
    return $rows_result;


}/***[/JCBGUI$$$$]***/

}
PKo�[�z�
��)reservation_search/reservation_search.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension type="plugin" version="3.8"
group="search" method="upgrade">
	<name>PLG_SEARCH_RESERVATION_SEARCH</name>
	<creationDate>28th March, 2023</creationDate>
	<author>farhad shahbazi</author>
	<authorEmail>farhad.shahbazi0010@gmail.com</authorEmail>
	<authorUrl>http://farhad.com</authorUrl>
	<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
	<license>GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html</license>
	<version>1.0.0</version>
	<description>PLG_SEARCH_RESERVATION_SEARCH_XML_DESCRIPTION</description>

	<!-- Language files -->
	<languages folder="language">
		<language
tag="en-GB">en-GB/en-GB.plg_search_reservation_search.ini</language>
		<language
tag="en-GB">en-GB/en-GB.plg_search_reservation_search.sys.ini</language>
	</languages>

	<!-- Plugin files -->
	<files>
		<filename
plugin="reservation_search">reservation_search.php</filename>
		<filename>index.html</filename>
		<folder>language</folder>
	</files>
</extension>PKo�[�#o,,rsticketsprocontent/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKo�[���dd+rsticketsprocontent/rsticketsprocontent.phpnu�[���<?php
/**
 * @package    RSTickets! Pro
 *
 * @copyright  (c) 2010 - 2016 RSJoomla!
 * @link       https://www.rsjoomla.com
 * @license    GNU General Public License
http://www.gnu.org/licenses/gpl-3.0.en.html
 */

// no direct access
defined('_JEXEC') or die( 'Restricted access' );

class plgSearchRsticketsprocontent extends JPlugin
{
	/**
	 * Load the language file on instantiation.
	 *
	 * @var    boolean
	 * @since  3.1
	 */
	protected $autoloadLanguage = true;
	
	/**
	 * @return array An array of search areas
	 */
	public function onContentSearchAreas() {
		static $areas = array(
			'rsticketsprocontent' => 'Knowledgebase'
		);
		return $areas;
	}
	
	/**
	 * Contacts Search method
	 *
	 * The sql must return the following fields that are used in a common
display
	 * routine: href, title, section, created, text, browsernav
	 *
	 * @param string Target search string
	 * @param string matching option, exact|any|all
	 * @param string ordering option, newest|oldest|popular|alpha|category
	 */
	public function onContentSearch($text, $phrase = '', $ordering =
'', $areas = null) {
		if
(!file_exists(JPATH_ADMINISTRATOR.'/components/com_rsticketspro/helpers/rsticketspro.php'))
			return false;
			
		require_once
JPATH_ADMINISTRATOR.'/components/com_rsticketspro/helpers/rsticketspro.php';
		
		if (is_array($areas)) {
			if (!array_intersect($areas,
array_keys($this->onContentSearchAreas()))) {
				return array();
			}
		}
		
		$db			= JFactory::getDbo();
		$query		= $db->getQuery(true);
		$searchText = $text;
		$text		= trim($text);
		$results	= array();

		if ($text == '') {
			return array();
		}
		
		$limit			= $this->params->def('search_limit', 50);
		$uncategorised	=
$this->params->def('search_uncategorised', 1);
		$itemid			= $this->params->def('Itemid',0);
		$itemid			= $itemid ? '&Itemid='.$itemid : '';
		
		$query->select($db->qn('a.id'))
			->select($db->qn('a.category_id'))
			->select($db->qn('a.name','title'))
			->select($db->qn('a.created'))->select($db->qn('a.text'))
			->select($db->qn('c.name','section'))
			->from($db->qn('#__rsticketspro_kb_content','a'))
			->join('LEFT',$db->qn('#__rsticketspro_kb_categories','c').'
ON '.$db->qn('a.category_id').' =
'.$db->qn('c.id'))
			->where($db->qn('a.published').' =
'.$db->q(1));
		
		if (!RSTicketsProHelper::isStaff()) {
			$query->where($db->qn('a.private').' =
'.$db->q(0));
		}
		
		if (!$uncategorised) {
			$query->where($db->qn('a.category_id').' >
'.$db->q(0));
		}
		
		switch ($phrase) {
			case 'exact':
				$text = $db->q('%' . $db->escape($text, true) .
'%', false);
				$query->where('('.$db->qn('a.name').'
LIKE '.$text.' OR '.$db->qn('a.text').'
LIKE '.$text.')');
				break;

			case 'all':
			case 'any':
			default:
				$words	= explode(' ', $text);
				$wheres	= array();
				
				foreach ($words as $word) {
					$word = $db->q('%' . $db->escape($word, true) .
'%', false);
					$wheres2   = array();
					$wheres2[] = $db->qn('a.name').' LIKE ' .
$word;
					$wheres2[] = $db->qn('a.text').' LIKE ' .
$word;
					$wheres[]  = implode(' OR ', $wheres2);
				}
				
				$where = '(' . implode(($phrase == 'all' ? ')
AND (' : ') OR ('), $wheres) . ')';
				$query->where($where);
				break;
		}

		switch ($ordering) {
			case 'oldest':
				$query->order($db->qn('a.created').'  ASC');
			break;

			case 'alpha':
				$query->order($db->qn('a.name').'  ASC');
			break;

			case 'category':
				$query->order($db->qn('section').'  ASC');
			break;

			case 'newest':
			default:
				$query->order($db->qn('a.created').' 
DESC');
			break;
		}

		$db->setQuery($query, 0, $limit);
		if ($rows = $db->loadObjectList()) {
			foreach ($rows as $i => $row) {
				$row->href			=
JRoute::_('index.php?option=com_rsticketspro&view=article&cid='.$row->id.':'.JFilterOutput::stringURLSafe($row->title).$itemid);
				$row->browsernav	= 2;
				$row->created		= $row->created;
				
				if (!$row->category_id && $uncategorised)
					$row->section = JText::_('Uncategorised Content');
				
				$results[] = $row;
			}
		}
		
		return $results;
	}
}PKo�[8��JJ+rsticketsprocontent/rsticketsprocontent.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension method="upgrade" version="2.5"
type="plugin" group="search">
	<name>plg_search_rsticketsprocontent</name>
	<author>RSJoomla!</author>
	<creationDate>February 2014</creationDate>
	<copyright>Copyright (C) 2010-2014 www.rsjoomla.com. All rights
reserved.</copyright>
	<license>GNU General Public License</license>
	<authorEmail>support@rsjoomla.com</authorEmail>
	<authorUrl>www.rsjoomla.com</authorUrl>
	<version>1.0.0</version>
	<description>RST_SEARCH_KB_DESC</description>
	
	<files>
		<filename
plugin="rsticketsprocontent">rsticketsprocontent.php</filename>
		<filename>index.html</filename>
	</files>
	
	<languages>
		<language
tag="en-GB">language/en-GB/en-GB.plg_search_rsticketsprocontent.ini</language>
		<language
tag="en-GB">language/en-GB/en-GB.plg_search_rsticketsprocontent.sys.ini</language>
	</languages>
	
	<config>
		<fields name="params">
			<fieldset name="basic">
				<field name="Itemid" type="text"
size="5" default="" label="RST_SEARCH_ITEMID"
description="RST_SEARCH_ITEMID_DESC"/>
				<field name="search_limit" type="text"
size="5" default="50"
label="RST_SEARCH_LIMIT"
description="RST_SEARCH_LIMIT_DESC"/>
				<field name="@spacer" type="spacer"
default="" label="" description="" />
				<field name="search_uncategorised" type="radio"
class="btn-group btn-group-yesno" default="1"
label="RST_SEARCH_UNCATEGORISED"
description="RST_SEARCH_UNCATEGORISED_DESC">
					<option value="0">JNO</option>
					<option value="1">JYES</option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>PKo�[�c&��
tags/tags.phpnu�[���<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Search.tags
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */
defined('_JEXEC') or die;

/**
 * Tags search plugin.
 *
 * @since  3.3
 */
class PlgSearchTags extends JPlugin
{
	/**
	 * Load the language file on instantiation.
	 *
	 * @var    boolean
	 * @since  3.3
	 */
	protected $autoloadLanguage = true;

	/**
	 * Determine areas searchable by this plugin.
	 *
	 * @return  array  An array of search areas.
	 *
	 * @since   3.3
	 */
	public function onContentSearchAreas()
	{
		static $areas = array(
			'tags' => 'PLG_SEARCH_TAGS_TAGS'
		);

		return $areas;
	}

	/**
	 * Search content (tags).
	 *
	 * The SQL must return the following fields that are used in a common
display
	 * routine: href, title, section, created, text, browsernav.
	 *
	 * @param   string  $text      Target search string.
	 * @param   string  $phrase    Matching option (possible values:
exact|any|all).  Default is "any".
	 * @param   string  $ordering  Ordering option (possible values:
newest|oldest|popular|alpha|category).  Default is "newest".
	 * @param   string  $areas     An array if the search is to be restricted
to areas or null to search all areas.
	 *
	 * @return  array  Search results.
	 *
	 * @since   3.3
	 */
	public function onContentSearch($text, $phrase = '', $ordering =
'', $areas = null)
	{
		$db    = JFactory::getDbo();
		$query = $db->getQuery(true);
		$app   = JFactory::getApplication();
		$user  = JFactory::getUser();
		$lang  = JFactory::getLanguage();

		$section = JText::_('PLG_SEARCH_TAGS_TAGS');
		$limit   = $this->params->def('search_limit', 50);

		if (is_array($areas) && !array_intersect($areas,
array_keys($this->onContentSearchAreas())))
		{
			return array();
		}

		$text = trim($text);

		if ($text === '')
		{
			return array();
		}

		$text = $db->quote('%' . $db->escape($text, true) .
'%', false);

		switch ($ordering)
		{
			case 'alpha':
				$order = 'a.title ASC';
				break;

			case 'newest':
				$order = 'a.created_time DESC';
				break;

			case 'oldest':
				$order = 'a.created_time ASC';
				break;

			case 'popular':
			default:
				$order = 'a.title DESC';
		}

		$query->select('a.id, a.title, a.alias, a.note, a.published,
a.access'
			. ', a.checked_out, a.checked_out_time, a.created_user_id'
			. ', a.path, a.parent_id, a.level, a.lft, a.rgt'
			. ', a.language, a.created_time AS created, a.description');

		$case_when_item_alias  = ' CASE WHEN ';
		$case_when_item_alias .= $query->charLength('a.alias',
'!=', '0');
		$case_when_item_alias .= ' THEN ';
		$a_id                  = $query->castAsChar('a.id');
		$case_when_item_alias .= $query->concatenate(array($a_id,
'a.alias'), ':');
		$case_when_item_alias .= ' ELSE ';
		$case_when_item_alias .= $a_id . ' END as slug';
		$query->select($case_when_item_alias);

		$query->from('#__tags AS a');
		$query->where('a.alias <> ' .
$db->quote('root'));

		$query->where('(a.title LIKE ' . $text . ' OR a.alias
LIKE ' . $text . ')');

		$query->where($db->qn('a.published') . ' = 1');

		if (!$user->authorise('core.admin'))
		{
			$groups = implode(',', $user->getAuthorisedViewLevels());
			$query->where('a.access IN (' . $groups . ')');
		}

		if ($app->isClient('site') &&
JLanguageMultilang::isEnabled())
		{
			$tag = JFactory::getLanguage()->getTag();
			$query->where('a.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')');
		}

		$query->order($order);

		$db->setQuery($query, 0, $limit);

		try
		{
			$rows = $db->loadObjectList();
		}
		catch (RuntimeException $e)
		{
			$rows = array();
			JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'),
'error');
		}

		if ($rows)
		{
			JLoader::register('TagsHelperRoute', JPATH_SITE .
'/components/com_tags/helpers/route.php');

			foreach ($rows as $key => $row)
			{
				$rows[$key]->href       =
TagsHelperRoute::getTagRoute($row->slug);
				$rows[$key]->text       = ($row->description !== '' ?
$row->description : $row->title);
				$rows[$key]->text      .= $row->note;
				$rows[$key]->section    = $section;
				$rows[$key]->created    = $row->created;
				$rows[$key]->browsernav = 0;
			}
		}

		if (!$this->params->get('show_tagged_items', 0))
		{
			return $rows;
		}
		else
		{
			$final_items = $rows;
			JModelLegacy::addIncludePath(JPATH_SITE .
'/components/com_tags/models');
			$tag_model = JModelLegacy::getInstance('Tag',
'TagsModel');
			$tag_model->getState();

			foreach ($rows as $key => $row)
			{
				$tag_model->setState('tag.id', $row->id);
				$tagged_items = $tag_model->getItems();

				if ($tagged_items)
				{
					foreach ($tagged_items as $k => $item)
					{
						// For 3rd party extensions we need to load the component strings
from its sys.ini file
						$parts = explode('.', $item->type_alias);
						$comp = array_shift($parts);
						$lang->load($comp, JPATH_SITE, null, false, true)
						|| $lang->load($comp, JPATH_SITE . '/components/' .
$comp, null, false, true);

						// Making up the type string
						$type = implode('_', $parts);
						$type = $comp . '_CONTENT_TYPE_' . $type;

						$new_item        = new stdClass;
						$new_item->href  = $item->link;
						$new_item->title = $item->core_title;
						$new_item->text  = $item->core_body;

						if ($lang->hasKey($type))
						{
							$new_item->section =
JText::sprintf('PLG_SEARCH_TAGS_ITEM_TAGGED_WITH',
JText::_($type), $row->title);
						}
						else
						{
							$new_item->section =
JText::sprintf('PLG_SEARCH_TAGS_ITEM_TAGGED_WITH',
$item->content_type_title, $row->title);
						}

						$new_item->created    = $item->displayDate;
						$new_item->browsernav = 0;
						$final_items[]        = $new_item;
					}
				}
			}

			return $final_items;
		}
	}
}
PKo�[#�GS��
tags/tags.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin"
group="search" method="upgrade">
	<name>plg_search_tags</name>
	<author>Joomla! Project</author>
	<creationDate>March 2014</creationDate>
	<copyright>Copyright (C) 2005 - 2020 Open Source Matters. All rights
reserved.</copyright>
	<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
	<authorEmail>admin@joomla.org</authorEmail>
	<authorUrl>www.joomla.org</authorUrl>
	<version>3.0.0</version>
	<description>PLG_SEARCH_TAGS_XML_DESCRIPTION</description>
	<files>
		<filename plugin="tags">tags.php</filename>
	</files>
	<languages>
		<language
tag="en-GB">en-GB.plg_search_tags.ini</language>
		<language
tag="en-GB">en-GB.plg_search_tags.sys.ini</language>
	</languages>
	<config>
		<fields name="params">
			<fieldset name="basic">
				<field
					name="search_limit"
					type="number"
					label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL"
					description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC"
					default="50"
					filter="integer"
					size="5"
				/>

				<field
					name="show_tagged_items"
					type="radio"
					label="PLG_SEARCH_TAGS_FIELD_SHOW_TAGGED_ITEMS_LABEL"
					description="PLG_SEARCH_TAGS_FIELD_SHOW_TAGGED_ITEMS_DESC"
					class="btn-group btn-group-yesno"
					default="0"
					filter="integer"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>
PKo�[��iMMsppagebuilder/sppagebuilder.phpnu�[���<?php
/**
 * @package     JoomShaper Plugin
 * @subpackage  Search.sppagebuilder
 *
 * @copyright   Copyright (C) 2015 Open Source Matters, Inc. All rights
reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Factory;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Language\Multilanguage;
/**
* Sppagebuilder search plugins
*
* @since 1.0.4
*/
class PlgSearchSppagebuilder extends CMSPlugin
{

	protected $autoloadLanguage = true;

	protected $app;

	/**
	 * Determine areas searchable by this plugin.
	 *
	 * @return  array  An array of search areas.
	 *
	 */

	public function onContentSearchAreas()
	{
		static $areas = array(
			'sppagebuilder' => 'SP_PAGEBUILDER_SEARCH_AREAS'
		);

		return $areas;
	}

	/**
	 * Search content (SP Pagebuilder).
	 *
	 * The SQL must return the following fields that are used in a common
display
	 * routine: href, title, section, created, text, browsernav.
	 *
	 * @param   string  $text      Target search string.
	 * @param   string  $phrase    Matching option (possible values:
exact|any|all).  Default is "any".
	 * @param   string  $ordering  Ordering option (possible values:
newest|oldest|popular|alpha|category).  Default is "newest".
	 * @param   mixed   $areas     An array if the search is to be restricted
to areas or null to search all areas.
	 *
	 * @return  array  Search results.
	 *
	 */

	public function onContentSearch( $text, $phrase = '', $ordering
= '', $areas = null )
	{
		$db 	= Factory::getDbo();
		$limit 	= $this->params->def('search_limit', 50);
		$tag    = Factory::getLanguage()->getTag();

		if (is_array($areas)) {
			if (!array_intersect($areas,
array_keys($this->onContentSearchAreas()))) {
				return array();
			}
		}

		$text = trim($text);

		if ($text == '') {
			return array();
		}

		JLoader::register('SppagebuilderRouter', JPATH_SITE .
'/components/com_sppagebuilder/route.php');

		switch ($phrase)
		{
			case 'exact':
			case 'all':
			case 'any':
			default:
				$text = $db->quote('%' . $db->escape($text, true) .
'%', false);
				$wheres1 = array();
				$wheres1[] = 's.title LIKE ' . $text;
				$wheres1[] = 's.text LIKE ' . $text;
				$where = '((' . implode(') OR (', $wheres1) .
')) AND s.published = 1';
				break;
		}

		switch ($ordering)
		{
			case 'oldest':
				$order = 's.created_time ASC';
				break;

			case 'alpha':
				$order = 's.title ASC';
				break;

			case 'newest':
			case 'category':
			case 'popular':
			default:
				$order = 's.created_on DESC';
				break;
		}

		$query = $db->getQuery(true);

		if ( $limit > 0 ) {
			$query->clear();
			$query->select('s.id as id, s.title AS title, s.created_on as
created, s.language as language');
			$query->from($db->quoteName('#__sppagebuilder',
's'));
			$query->where($db->quoteName('s.extension') . ' =
'  . $db->quote('com_sppagebuilder'));
			$query->where($where);

			if ($this->app->isClient('site') &&
Multilanguage::isEnabled())
			{
				$query->where('s.language in (' . $db->quote($tag) .
',' . $db->quote('*') . ')');
			}

			$query->order($order);

			$db->setQuery($query, 0, $limit);
		}
	
		try
		{
			$list = $db->loadObjectList();

			if (isset($list))
			{
				foreach ($list as $key => $item)
				{
					$menuItem = $this->getActiveMenu($item->id);
					// if(isset($menuItem->title) && $menuItem->title) {
					// 	$list[$key]->title = $menuItem->title;
					// }
					$itemId = '';
					if(isset($menuItem->id) && $menuItem->id) {
						$itemId = '&Itemid=' . $menuItem->id;
					}
					$list[$key]->href =
Route::_('index.php?option=com_sppagebuilder&view=page&id='.$item->id.((($item->language
!= '*'))? '&lang='.$item->language:'')
. $itemId);
				}
			}
		}
		catch (RuntimeException $e)
		{
			$list = array();
			$this->app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'),
'error');
		}

		return $list;
	}

	public static function getActiveMenu($pageId) {
		$db = Factory::getDbo();
		$query = $db->getQuery(true);
		$query->select(array('title, id'));
		$query->from($db->quoteName('#__menu'));
		$query->where($db->quoteName('link') . ' LIKE
'.
$db->quote('%option=com_sppagebuilder&view=page&id='.
$pageId .'%'));
		$query->where($db->quoteName('published') . ' =
'. $db->quote('1'));
		$db->setQuery($query);
		$item = $db->loadObject();

		return $item;
	}
}
PKo�[d�mIYYsppagebuilder/sppagebuilder.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension version="3.9" type="plugin"
group="search" method="upgrade">
	<name>plg_search_sppagebuilder</name>
	<author>JoomShaper</author>
	<creationDate>July 2015</creationDate>
	<copyright>Copyright (C) 2015 Open Source Matters. All rights
reserved.</copyright>
	<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
	<authorEmail>support@joomshaper.com</authorEmail>
	<authorUrl>www.joomshaper.com</authorUrl>
	<version>5.0.9</version>
	<description>PLG_SEARCH_SPPAGEBUILDER_DESCRIPTION</description>
	<files>
		<filename
plugin="sppagebuilder">sppagebuilder.php</filename>
	</files>
	<languages>
		<language
tag="en-GB">language/en-GB.plg_search_sppagebuilder.ini</language>
		<language
tag="en-GB">language/en-GB.plg_search_sppagebuilder.sys.ini</language>
	</languages>
</extension>
PK(&�[�7��tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_finder
 *
 * @copyright   (C) 2011 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.core');
JHtml::_('formbehavior.chosen');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('stylesheet', 'com_finder/finder.css',
array('version' => 'auto', 'relative'
=> true));

?>
<div class="finder<?php echo $this->pageclass_sfx;
?>">
	<?php if ($this->params->get('show_page_heading')) :
?>
		<h1>
			<?php if
($this->escape($this->params->get('page_heading'))) :
?>
				<?php echo
$this->escape($this->params->get('page_heading')); ?>
			<?php else : ?>
				<?php echo
$this->escape($this->params->get('page_title')); ?>
			<?php endif; ?>
		</h1>
	<?php endif; ?>
	<?php if ($this->params->get('show_search_form', 1)) :
?>
		<div id="search-form">
			<?php echo $this->loadTemplate('form'); ?>
		</div>
	<?php endif; ?>
	<?php // Load the search results layout if we are performing a search.
?>
	<?php if ($this->query->search === true) : ?>
		<div id="search-results">
			<?php echo $this->loadTemplate('results'); ?>
		</div>
	<?php endif; ?>
</div>
PK(&�[g)4�""tmpl/default.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_FINDER_MENU_SEARCH_VIEW_DEFAULT_TITLE">
		<help
			key = "JHELP_MENUS_MENU_ITEM_FINDER_SEARCH"
		/>
		<message>
			<![CDATA[COM_FINDER_MENU_SEARCH_VIEW_DEFAULT_TEXT]]>
		</message>
	</layout>

	<fields name="request"
addfieldpath="/administrator/components/com_finder/models/fields">
		<fieldset name="request">
			<field
				name="q"
				type="text"
				label="COM_FINDER_SEARCH_SEARCH_QUERY_LABEL"
				description="COM_FINDER_SEARCH_SEARCH_QUERY_DESC"
				size="30"
			/>
			<field
				name="f"
				type="searchfilter"
				label="COM_FINDER_SEARCH_FILTER_SEARCH_LABEL"
				description="COM_FINDER_SEARCH_FILTER_SEARCH_DESC"
				default=""
			/>
		</fieldset>
	</fields>
	<fields name="params"
addfieldpath="/administrator/components/com_finder/models/fields">
		<fieldset name="basic">
			<field
				name="show_date_filters"
				type="list"
				label="COM_FINDER_CONFIG_SHOW_DATE_FILTERS_LABEL"
				description="COM_FINDER_CONFIG_SHOW_DATE_FILTERS_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="1">JSHOW</option>
				<option value="0">JHIDE</option>
			</field>
			<field
				name="show_advanced"
				type="list"
				label="COM_FINDER_CONFIG_SHOW_ADVANCED_LABEL"
				description="COM_FINDER_CONFIG_SHOW_ADVANCED_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="1">JSHOW</option>
				<option value="0">JHIDE</option>
			</field>
			<field
				name="expand_advanced"
				type="list"
				label="COM_FINDER_CONFIG_EXPAND_ADVANCED_LABEL"
				description="COM_FINDER_CONFIG_EXPAND_ADVANCED_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="1">JSHOW</option>
				<option value="0">JHIDE</option>
			</field>
			<field type="spacer" />
			<field
				name="show_description"
				type="list"
				label="COM_FINDER_CONFIG_SHOW_DESCRIPTION_LABEL"
				description="COM_FINDER_CONFIG_SHOW_DESCRIPTION_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="1">JSHOW</option>
				<option value="0">JHIDE</option>
			</field>
			<field
				name="description_length"
				type="number"
				label="COM_FINDER_CONFIG_DESCRIPTION_LENGTH_LABEL"
				description="COM_FINDER_CONFIG_DESCRIPTION_LENGTH_DESC"
				default=""
				size="5"
				useglobal="true"
			/>
			<field
				name="show_url"
				type="list"
				label="COM_FINDER_CONFIG_SHOW_URL_LABEL"
				description="COM_FINDER_CONFIG_SHOW_URL_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="1">JSHOW</option>
				<option value="0">JHIDE</option>
			</field>
			<field type="spacer" />
		</fieldset>
		<fieldset name="advanced">
			<field
				name="show_pagination_limit"
				type="list"
				label="JGLOBAL_DISPLAY_SELECT_LABEL"
				description="JGLOBAL_DISPLAY_SELECT_DESC"
				validate="options"
				class="chzn-color"
				>
				<option value="">JGLOBAL_USE_GLOBAL</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>
			<field
				name="show_pagination"
				type="list"
				label="JGLOBAL_PAGINATION_LABEL"
				description="JGLOBAL_PAGINATION_DESC"
				validate="options"
				class="chzn-color"
				>
				<option value="">JGLOBAL_USE_GLOBAL</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
				<option value="2">JGLOBAL_AUTO</option>
			</field>
			<field
				name="show_pagination_results"
				type="list"
				label="JGLOBAL_PAGINATION_RESULTS_LABEL"
				description="JGLOBAL_PAGINATION_RESULTS_DESC"
				validate="options"
				class="chzn-color"
				>
				<option value="">JGLOBAL_USE_GLOBAL</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>
			<field
				name="allow_empty_query"
				type="list"
				label="COM_FINDER_ALLOW_EMPTY_QUERY_LABEL"
				description="COM_FINDER_ALLOW_EMPTY_QUERY_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="1">JYES</option>
				<option value="0">JNO</option>
			</field>
			<field
				name="show_suggested_query"
				type="list"
				label="COM_FINDER_CONFIG_SHOW_SUGGESTED_QUERY_LABEL"
				description="COM_FINDER_CONFIG_SHOW_SUGGESTED_QUERY_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="1">JYES</option>
				<option value="0">JNO</option>
			</field>
			<field
				name="show_explained_query"
				type="list"
				label="COM_FINDER_CONFIG_SHOW_EXPLAINED_QUERY_LABEL"
				description="COM_FINDER_CONFIG_SHOW_EXPLAINED_QUERY_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="1">JYES</option>
				<option value="0">JNO</option>
			</field>
			<field
				name="sort_order"
				type="list"
				label="COM_FINDER_CONFIG_SORT_ORDER_LABEL"
				description="COM_FINDER_CONFIG_SORT_ORDER_DESC"
				default=""
				useglobal="true"
				>
				<option
value="relevance">COM_FINDER_CONFIG_SORT_OPTION_RELEVANCE</option>
				<option
value="date">COM_FINDER_CONFIG_SORT_OPTION_START_DATE</option>
				<option
value="price">COM_FINDER_CONFIG_SORT_OPTION_LIST_PRICE</option>
			</field>
			<field
				name="sort_direction"
				type="list"
				label="COM_FINDER_CONFIG_SORT_DIRECTION_LABEL"
				description="COM_FINDER_CONFIG_SORT_DIRECTION_DESC"
				default=""
				useglobal="true"
				>
				<option
value="desc">COM_FINDER_CONFIG_SORT_OPTION_DESCENDING</option>
				<option
value="asc">COM_FINDER_CONFIG_SORT_OPTION_ASCENDING</option>
			</field>
		</fieldset>
		<fieldset name="integration">
			<field
				name="show_feed_link"
				type="list"
				label="JGLOBAL_SHOW_FEED_LINK_LABEL"
				description="JGLOBAL_SHOW_FEED_LINK_DESC"
				validate="options"
				class="chzn-color"
				>
				<option value="">JGLOBAL_USE_GLOBAL</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>
		</fieldset>
	</fields>
</metadata>
PK)&�[���
�
tmpl/default_form.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_finder
 *
 * @copyright   (C) 2011 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

if ($this->params->get('show_advanced', 1) ||
$this->params->get('show_autosuggest', 1))
{
	JHtml::_('jquery.framework');

	$script = "
jQuery(function() {";

	if ($this->params->get('show_advanced', 1))
	{
		/*
		* This segment of code disables select boxes that have no value when the
		* form is submitted so that the URL doesn't get blown up with null
values.
		*/
		$script .= "
	jQuery('#finder-search').on('submit', function(e){
		e.stopPropagation();
		// Disable select boxes with no value selected.
		jQuery('#advancedSearch').find('select').each(function(index,
el) {
			var el = jQuery(el);
			if(!el.val()){
				el.attr('disabled', 'disabled');
			}
		});
	});";
	}

	/*
	* This segment of code sets up the autocompleter.
	*/
	if ($this->params->get('show_autosuggest', 1))
	{
		JHtml::_('script', 'jui/jquery.autocomplete.min.js',
array('version' => 'auto', 'relative'
=> true));

		$script .= "
	var suggest = jQuery('#q').autocomplete({
		serviceUrl: '" .
JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component')
. "',
		paramName: 'q',
		minChars: 1,
		maxHeight: 400,
		width: 300,
		zIndex: 9999,
		deferRequestBy: 500
	});";
	}

	$script .= "
});";

	JFactory::getDocument()->addScriptDeclaration($script);
}

?>
<form id="finder-search" action="<?php echo
JRoute::_($this->query->toUri()); ?>" method="get"
class="form-inline">
	<?php echo $this->getFields(); ?>
	<?php // DISABLED UNTIL WEIRD VALUES CAN BE TRACKED DOWN. ?>
	<?php if (false &&
$this->state->get('list.ordering') !==
'relevance_dsc') : ?>
		<input type="hidden" name="o" value="<?php
echo $this->escape($this->state->get('list.ordering'));
?>" />
	<?php endif; ?>
	<fieldset class="word">
		<label for="q">
			<?php echo JText::_('COM_FINDER_SEARCH_TERMS'); ?>
		</label>
		<input type="text" name="q" id="q"
size="30" value="<?php echo
$this->escape($this->query->input); ?>"
class="inputbox" />
		<?php if ($this->escape($this->query->input) != ''
|| $this->params->get('allow_empty_query')) : ?>
			<button name="Search" type="submit"
class="btn btn-primary">
				<span class="icon-search icon-white"></span>
				<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>
			</button>
		<?php else : ?>
			<button name="Search" type="submit"
class="btn btn-primary disabled">
				<span class="icon-search icon-white"></span>
				<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>
			</button>
		<?php endif; ?>
		<?php if ($this->params->get('show_advanced', 1)) :
?>
			<a href="#advancedSearch" data-toggle="collapse"
class="btn">
				<span class="icon-list"
aria-hidden="true"></span>
				<?php echo JText::_('COM_FINDER_ADVANCED_SEARCH_TOGGLE');
?>
			</a>
		<?php endif; ?>
	</fieldset>
	<?php if ($this->params->get('show_advanced', 1)) :
?>
		<div id="advancedSearch" class="collapse<?php if
($this->params->get('expand_advanced', 0)) echo '
in'; ?>">
			<hr />
			<?php if ($this->params->get('show_advanced_tips',
1)) : ?>
				<div id="search-query-explained">
					<div class="advanced-search-tip">
						<?php echo JText::_('COM_FINDER_ADVANCED_TIPS'); ?>
					</div>
					<hr />
				</div>
			<?php endif; ?>
			<div id="finder-filter-window">
				<?php echo JHtml::_('filter.select', $this->query,
$this->params); ?>
			</div>
		</div>
	<?php endif; ?>
</form>
PK)&�[1�bm�	�	tmpl/default_result.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_finder
 *
 * @copyright   (C) 2011 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\String\StringHelper;

// Get the mime type class.
$mime = !empty($this->result->mime) ? 'mime-' .
$this->result->mime : null;

$show_description = $this->params->get('show_description',
1);

if ($show_description)
{
	// Calculate number of characters to display around the result
	$term_length = StringHelper::strlen($this->query->input);
	$desc_length = $this->params->get('description_length',
255);
	$pad_length  = $term_length < $desc_length ? (int) floor(($desc_length
- $term_length) / 2) : 0;

	// Make sure we highlight term both in introtext and fulltext
	if (!empty($this->result->summary) &&
!empty($this->result->body))
	{
		$full_description =
FinderIndexerHelper::parse($this->result->summary .
$this->result->body);
	}
	else
	{
		$full_description = $this->result->description;
	}

	// Find the position of the search term
	$pos = $term_length ?
StringHelper::strpos(StringHelper::strtolower($full_description),
StringHelper::strtolower($this->query->input)) : false;

	// Find a potential start point
	$start = ($pos && $pos > $pad_length) ? $pos - $pad_length : 0;

	// Find a space between $start and $pos, start right after it.
	$space = StringHelper::strpos($full_description, ' ', $start
> 0 ? $start - 1 : 0);
	$start = ($space && $space < $pos) ? $space + 1 : $start;

	$description = JHtml::_('string.truncate',
StringHelper::substr($full_description, $start), $desc_length, true);
}

$route = $this->result->route;

// Get the route with highlighting information.
if (!empty($this->query->highlight)
	&& empty($this->result->mime)
	&& $this->params->get('highlight_terms', 1)
	&& JPluginHelper::isEnabled('system',
'highlight'))
{
	$route .= '&highlight=' .
base64_encode(json_encode($this->query->highlight));
}

?>
<li>
	<h4 class="result-title <?php echo $mime; ?>">
		<a href="<?php echo JRoute::_($route); ?>">
			<?php echo $this->result->title; ?>
		</a>
	</h4>
	<?php if ($show_description && $description !== '') :
?>
		<p class="result-text<?php echo $this->pageclass_sfx;
?>">
			<?php echo $description; ?>
		</p>
	<?php endif; ?>
	<?php if ($this->params->get('show_url', 1)) : ?>
		<div class="small result-url<?php echo
$this->pageclass_sfx; ?>">
			<?php echo $this->baseUrl, JRoute::_($this->result->route);
?>
		</div>
	<?php endif; ?>
</li>
PK)&�[�����tmpl/default_results.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_finder
 *
 * @copyright   (C) 2011 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

?>
<?php // Display the suggested search if it is different from the
current search. ?>
<?php if (($this->suggested &&
$this->params->get('show_suggested_query', 1)) ||
($this->explained &&
$this->params->get('show_explained_query', 1))) : ?>
	<div id="search-query-explained">
		<?php // Display the suggested search query. ?>
		<?php if ($this->suggested &&
$this->params->get('show_suggested_query', 1)) : ?>
			<?php // Replace the base query string with the suggested query
string. ?>
			<?php $uri = JUri::getInstance($this->query->toUri()); ?>
			<?php $uri->setVar('q', $this->suggested); ?>
			<?php // Compile the suggested query link. ?>
			<?php $linkUrl = JRoute::_($uri->toString(array('path',
'query'))); ?>
			<?php $link = '<a href="' . $linkUrl .
'">' . $this->escape($this->suggested) .
'</a>'; ?>
			<?php echo JText::sprintf('COM_FINDER_SEARCH_SIMILAR',
$link); ?>
		<?php elseif ($this->explained &&
$this->params->get('show_explained_query', 1)) : ?>
			<?php // Display the explained search query. ?>
			<?php echo $this->explained; ?>
		<?php endif; ?>
	</div>
<?php endif; ?>
<?php // Display the 'no results' message and exit the
template. ?>
<?php if (($this->total === 0) || ($this->total === null)) : ?>
	<div id="search-result-empty">
		<h2><?php echo
JText::_('COM_FINDER_SEARCH_NO_RESULTS_HEADING');
?></h2>
		<?php $multilang = JFactory::getApplication()->getLanguageFilter()
? '_MULTILANG' : ''; ?>
		<p><?php echo
JText::sprintf('COM_FINDER_SEARCH_NO_RESULTS_BODY' . $multilang,
$this->escape($this->query->input)); ?></p>
	</div>
	<?php // Exit this template. ?>
	<?php return; ?>
<?php endif; ?>
<?php // Activate the highlighter if enabled. ?>
<?php if (!empty($this->query->highlight) &&
$this->params->get('highlight_terms', 1)) : ?>
	<?php JHtml::_('behavior.highlighter',
$this->query->highlight); ?>
<?php endif; ?>
<?php // Display a list of results ?>
<br id="highlighter-start" />
<ul class="search-results<?php echo $this->pageclass_sfx;
?> list-striped">
	<?php $this->baseUrl =
JUri::getInstance()->toString(array('scheme',
'host', 'port')); ?>
	<?php foreach ($this->results as $result) : ?>
		<?php $this->result = &$result; ?>
		<?php $layout = $this->getLayoutFile($this->result->layout);
?>
		<?php echo $this->loadTemplate($layout); ?>
	<?php endforeach; ?>
</ul>
<br id="highlighter-end" />
<?php // Display the pagination ?>
<div class="search-pagination">
	<div class="pagination">
		<?php echo $this->pagination->getPagesLinks(); ?>
	</div>
	<div class="search-pages-counter">
		<?php // Prepare the pagination string.  Results X - Y of Z ?>
		<?php $start = (int)
$this->pagination->get('limitstart') + 1; ?>
		<?php $total = (int) $this->pagination->get('total');
?>
		<?php $limit = (int) $this->pagination->get('limit') *
$this->pagination->get('pages.current'); ?>
		<?php $limit = (int) ($limit > $total ? $total : $limit); ?>
		<?php echo JText::sprintf('COM_FINDER_SEARCH_RESULTS_OF',
$start, $limit, $total); ?>
	</div>
</div>
PK)&�[Vb��w
w

view.feed.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_finder
 *
 * @copyright   (C) 2011 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 feed view class for the Finder package.
 *
 * @since  2.5
 */
class FinderViewSearch extends JViewLegacy
{
	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  A template file to load. [optional]
	 *
	 * @return  mixed  JError object on failure, void on success.
	 *
	 * @since   2.5
	 */
	public function display($tpl = null)
	{
		// Get the application
		$app = JFactory::getApplication();

		// Adjust the list limit to the feed limit.
		$app->input->set('limit',
$app->get('feed_limit'));

		// Get view data.
		$state = $this->get('State');
		$params = $state->get('params');
		$query = $this->get('Query');
		$results = $this->get('Results');

		// Push out the query data.
		JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
		$explained = JHtml::_('query.explained', $query);

		// Set the document title.
		$title = $params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
		}

		$this->document->setTitle($title);

		// Configure the document description.
		if (!empty($explained))
		{
			$this->document->setDescription(html_entity_decode(strip_tags($explained),
ENT_QUOTES, 'UTF-8'));
		}

		// Set the document link.
		$this->document->link = JRoute::_($query->toUri());

		// If we don't have any results, we are done.
		if (empty($results))
		{
			return;
		}

		// Convert the results to feed entries.
		foreach ($results as $result)
		{
			// Convert the result to a feed entry.
			$item              = new JFeedItem;
			$item->title       = $result->title;
			$item->link        = JRoute::_($result->route);
			$item->description = $result->description;

			// Use Unix date to cope for non-english languages
			$item->date        = (int) $result->start_date ?
JHtml::_('date', $result->start_date, 'U') :
$result->indexdate;

			// Get the taxonomy data.
			$taxonomy = $result->getTaxonomy();

			// Add the category to the feed if available.
			if (isset($taxonomy['Category']))
			{
				$node           = array_pop($taxonomy['Category']);
				$item->category = $node->title;
			}

			// Loads item info into RSS array
			$this->document->addItem($item);
		}
	}
}
PK)&�[���66
view.html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_finder
 *
 * @copyright   (C) 2011 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Helper\SearchHelper;

/**
 * Search HTML view class for the Finder package.
 *
 * @since  2.5
 */
class FinderViewSearch extends JViewLegacy
{
	/**
	 * The query object
	 *
	 * @var  FinderIndexerQuery
	 */
	protected $query;

	/**
	 * The application parameters
	 *
	 * @var  Registry  The parameters object
	 */
	protected $params;

	/**
	 * The model state
	 *
	 * @var  object
	 */
	protected $state;

	protected $user;

	/**
	 * An array of results
	 *
	 * @var    array
	 *
	 * @since  3.8.0
	 */
	protected $results;

	/**
	 * The total number of items
	 *
	 * @var    integer
	 *
	 * @since  3.8.0
	 */
	protected $total;

	/**
	 * The pagination object
	 *
	 * @var    JPagination
	 *
	 * @since  3.8.0
	 */
	protected $pagination;

	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  A template file to load. [optional]
	 *
	 * @return  mixed  JError object on failure, void on success.
	 *
	 * @since   2.5
	 */
	public function display($tpl = null)
	{
		$app    = JFactory::getApplication();
		$params = $app->getParams();

		// Get view data.
		$state = $this->get('State');
		$query = $this->get('Query');
		JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderQuery')
: null;
		$results = $this->get('Results');
		JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderResults')
: null;
		$total = $this->get('Total');
		JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderTotal')
: null;
		$pagination = $this->get('Pagination');
		JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderPagination')
: null;

		// Flag indicates to not add limitstart=0 to URL
		$pagination->hideEmptyLimitstart = true;

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode("\n", $errors));

			return false;
		}

		// Configure the pathway.
		if (!empty($query->input))
		{
			$app->getPathway()->addItem($this->escape($query->input));
		}

		// Push out the view data.
		$this->state      = &$state;
		$this->params     = &$params;
		$this->query      = &$query;
		$this->results    = &$results;
		$this->total      = &$total;
		$this->pagination = &$pagination;

		// Check for a double quote in the query string.
		if (strpos($this->query->input, '"'))
		{
			// Get the application router.
			$router = &$app::getRouter();

			// Fix the q variable in the URL.
			if ($router->getVar('q') !== $this->query->input)
			{
				$router->setVar('q', $this->query->input);
			}
		}

		// Log the search
		SearchHelper::logSearch($this->query->input,
'com_finder');

		// Push out the query data.
		JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
		$this->suggested = JHtml::_('query.suggested', $query);
		$this->explained = JHtml::_('query.explained', $query);

		// Escape strings for HTML output
		$this->pageclass_sfx =
htmlspecialchars($params->get('pageclass_sfx', ''));

		// Check for layout override only if this is not the active menu item
		// If it is the active menu item, then the view and category id will
match
		$active = $app->getMenu()->getActive();

		if (isset($active->query['layout']))
		{
			// We need to set the layout in case this is an alternative menu item
(with an alternative layout)
			$this->setLayout($active->query['layout']);
		}

		$this->prepareDocument($query);

		JDEBUG ?
JProfiler::getInstance('Application')->mark('beforeFinderLayout')
: null;

		parent::display($tpl);

		JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderLayout')
: null;
	}

	/**
	 * Method to get hidden input fields for a get form so that control
variables
	 * are not lost upon form submission
	 *
	 * @return  string  A string of hidden input form fields
	 *
	 * @since   2.5
	 */
	protected function getFields()
	{
		$fields = null;

		// Get the URI.
		$uri = JUri::getInstance(JRoute::_($this->query->toUri()));
		$uri->delVar('q');
		$uri->delVar('o');
		$uri->delVar('t');
		$uri->delVar('d1');
		$uri->delVar('d2');
		$uri->delVar('w1');
		$uri->delVar('w2');
		$elements = $uri->getQuery(true);

		// Create hidden input elements for each part of the URI.
		foreach ($elements as $n => $v)
		{
			if (is_scalar($v))
			{
				$fields .= '<input type="hidden" name="' .
$n . '" value="' . $v . '" />';
			}
		}

		return $fields;
	}

	/**
	 * Method to get the layout file for a search result object.
	 *
	 * @param   string  $layout  The layout file to check. [optional]
	 *
	 * @return  string  The layout file to use.
	 *
	 * @since   2.5
	 */
	protected function getLayoutFile($layout = null)
	{
		// Create and sanitize the file name.
		$file = $this->_layout . '_' .
preg_replace('/[^A-Z0-9_\.-]/i', '', $layout);

		// Check if the file exists.
		jimport('joomla.filesystem.path');
		$filetofind = $this->_createFileName('template',
array('name' => $file));
		$exists     = JPath::find($this->_path['template'],
$filetofind);

		return ($exists ? $layout : 'result');
	}

	/**
	 * Prepares the document
	 *
	 * @param   FinderIndexerQuery  $query  The search query
	 *
	 * @return  void
	 *
	 * @since   2.5
	 */
	protected function prepareDocument($query)
	{
		$app   = JFactory::getApplication();
		$menus = $app->getMenu();
		$title = null;

		// Because the application sets a default page title,
		// we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading',
$this->params->get('page_title', $menu->title));
		}
		else
		{
			$this->params->def('page_heading',
JText::_('COM_FINDER_DEFAULT_PAGE_TITLE'));
		}

		$title = $this->params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
		}

		$this->document->setTitle($title);

		if ($layout = $this->params->get('article_layout'))
		{
			$this->setLayout($layout);
		}

		// Configure the document meta-description.
		if (!empty($this->explained))
		{
			$explained =
$this->escape(html_entity_decode(strip_tags($this->explained),
ENT_QUOTES, 'UTF-8'));
			$this->document->setDescription($explained);
		}
		elseif ($this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		// Configure the document meta-keywords.
		if (!empty($query->highlight))
		{
			$this->document->setMetaData('keywords', implode(',
', $query->highlight));
		}
		elseif ($this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetadata('robots',
$this->params->get('robots'));
		}

		// Add feed link to the document head.
		if ($this->params->get('show_feed_link', 1) == 1)
		{
			// Add the RSS link.
			$props = array('type' => 'application/rss+xml',
'title' => 'RSS 2.0');
			$route = JRoute::_($this->query->toUri() .
'&format=feed&type=rss');
			$this->document->addHeadLink($route, 'alternate',
'rel', $props);

			// Add the ATOM link.
			$props = array('type' => 'application/atom+xml',
'title' => 'Atom 1.0');
			$route = JRoute::_($this->query->toUri() .
'&format=feed&type=atom');
			$this->document->addHeadLink($route, 'alternate',
'rel', $props);
		}
	}
}
PK)&�[<-(MMview.opensearch.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_finder
 *
 * @copyright   (C) 2011 Open Source Matters, Inc.
<https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * OpenSearch View class for Finder
 *
 * @since  2.5
 */
class FinderViewSearch extends JViewLegacy
{
	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  A template file to load. [optional]
	 *
	 * @return  mixed  JError object on failure, void on success.
	 *
	 * @since   2.5
	 */
	public function display($tpl = null)
	{
		$doc = JFactory::getDocument();
		$app = JFactory::getApplication();

		$params = JComponentHelper::getParams('com_finder');
		$doc->setShortName($params->get('opensearch_name',
$app->get('sitename')));
		$doc->setDescription($params->get('opensearch_description',
$app->get('MetaDesc')));

		// Add the URL for the search
		$searchUri = JUri::base() .
'index.php?option=com_finder&q={searchTerms}';

		// Find the menu item for the search
		$menu  = $app->getMenu();
		$items = $menu->getItems('link',
'index.php?option=com_finder&view=search');

		if (isset($items[0]))
		{
			$searchUri .= '&Itemid=' . $items[0]->id;
		}

		$htmlSearch           = new JOpenSearchUrl;
		$htmlSearch->template = JRoute::_($searchUri);
		$doc->addUrl($htmlSearch);
	}
}
PKo�[���l��categories/categories.phpnu�[���PKo�[�#�z�categories/categories.xmlnu�[���PKo�[�s�YDD$contacts/contacts.phpnu�[���PKo�[Tjr����/contacts/contacts.xmlnu�[���PKo�[y�ê�4�4�6content/content.phpnu�[���PKo�[���

�kcontent/content.xmlnu�[���PKo�[�E��)shikamarket_vendors/hikamarket_vendors.phpnu�[���PKo�[����
�
)v�hikamarket_vendors/hikamarket_vendors.xmlnu�[���PKo�[�#o,,��hikamarket_vendors/index.htmlnu�[���PKo�[~׃
##+�hikashop_categories/hikashop_categories.phpnu�[���PKo�[�w�ת
�
+��hikashop_categories/hikashop_categories.xmlnu�[���PKo�[�#o,,��hikashop_categories/index.htmlnu�[���PKo�[���0�0'�hikashop_products/hikashop_products.phpnu�[���PKo�[�&��'�hikashop_products/hikashop_products.xmlnu�[���PKo�[�#o,,�hikashop_products/index.htmlnu�[���PKo�[�|5-]newsfeeds/newsfeeds.phpnu�[���PKo�[.rrm���newsfeeds/newsfeeds.xmlnu�[���PKo�[�#o,,reservation_search/index.htmlnu�[���PKo�[Cg
��I|reservation_search/language/en-GB/en-GB.plg_search_reservation_search.ininu�[���PKo�[Cg
��M�!reservation_search/language/en-GB/en-GB.plg_search_reservation_search.sys.ininu�[���PKo�[�#o,,,�#reservation_search/language/en-GB/index.htmlnu�[���PKo�[�#o,,&4$reservation_search/language/index.htmlnu�[���PKo�[k�0>>)�$reservation_search/reservation_search.phpnu�[���PKo�[�z�
��)M4reservation_search/reservation_search.xmlnu�[���PKo�[�#o,,�8rsticketsprocontent/index.htmlnu�[���PKo�[���dd+9rsticketsprocontent/rsticketsprocontent.phpnu�[���PKo�[8��JJ+�Irsticketsprocontent/rsticketsprocontent.xmlnu�[���PKo�[�c&��
~Ptags/tags.phpnu�[���PKo�[#�GS��
�gtags/tags.xmlnu�[���PKo�[��iMM�msppagebuilder/sppagebuilder.phpnu�[���PKo�[d�mIYY<sppagebuilder/sppagebuilder.xmlnu�[���PK(&�[�7���tmpl/default.phpnu�[���PK(&�[g)4�""�tmpl/default.xmlnu�[���PK)&�[���
�
h�tmpl/default_form.phpnu�[���PK)&�[1�bm�	�	��tmpl/default_result.phpnu�[���PK)&�[�����÷tmpl/default_results.phpnu�[���PK)&�[Vb��w
w

��view.feed.phpnu�[���PK)&�[���66
r�view.html.phpnu�[���PK)&�[<-(MM��view.opensearch.phpnu�[���PK''qu�