uawdijnntqw1x1x1
IP : 216.73.216.231
Hostname : 213-108-241-110.cprapid.com
Kernel : Linux 213-108-241-110.cprapid.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
digilove
/
public_html
/
f7525
/
..
/
libraries
/
..
/
41423
/
search.tar
/
/
categories/categories.php000064400000011604152325744550011545 0ustar00<?php /** * @package Joomla.Plugin * @subpackage Search.categories * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; 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; } } categories/categories.xml000064400000003340152325744550011554 0ustar00<?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>(C) 2005 Open Source Matters, Inc.</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> categories/index.html000064400000000037152325744550010702 0ustar00<!DOCTYPE html><title></title> contacts/contacts.php000064400000012067152325744550010733 0ustar00<?php /** * @package Joomla.Plugin * @subpackage Search.contacts * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * 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; } } contacts/contacts.xml000064400000003322152325744550010736 0ustar00<?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>(C) 2005 Open Source Matters, Inc.</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> contacts/index.html000064400000000037152325744550010373 0ustar00<!DOCTYPE html><title></title> content/content.php000064400000032177152325744550010427 0ustar00<?php /** * @package Joomla.Plugin * @subpackage Search.content * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * 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; } } content/content.xml000064400000003377152325744550010440 0ustar00<?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>(C) 2005 Open Source Matters, Inc.</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> content/index.html000064400000000037152325744550010227 0ustar00<!DOCTYPE html><title></title> newsfeeds/index.html000064400000000037152325744550010540 0ustar00<!DOCTYPE html><title></title> newsfeeds/newsfeeds.php000064400000012022152325744550011234 0ustar00<?php /** * @package Joomla.Plugin * @subpackage Search.newsfeeds * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * 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; } } newsfeeds/newsfeeds.xml000064400000003330152325744550011247 0ustar00<?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>(C) 2005 Open Source Matters, Inc.</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> removeshortcode/index.html000064400000000000152325744550011753 0ustar00removeshortcode/removeshortcode.php000064400000030217152325744550013714 0ustar00<?php /** * @package Shortcode Ultimate * @author BdThemes http://www.bdthemes.com * @copyright Copyright (C) BdThemes Ltd * @license http://www.gnu.org/licenses/gpl.html GNU/GPL */ defined('_JEXEC') or die; /** * Content search plugin. * * @since 1.6 */ class PlgSearchRemoveShortcode 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 3.3.0 */ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $tag = JFactory::getLanguage()->getTag(); require_once JPATH_SITE . '/components/com_content/helpers/route.php'; require_once JPATH_ADMINISTRATOR . '/components/com_search/helpers/search.php'; $searchText = $text; if (is_array($areas)) { if (!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; $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[] = '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 . ')'; $wheres[] = implode(' OR ', $wheres2); } $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'; $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->isSite() && 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'; $query->select( 'a.title AS title, a.metadesc, a.metakey, a.created AS created, ' . $query->concatenate(array("a.introtext", "a.fulltext")) . ' AS text,' . $case_when . ',' . $case_when1 . ', ' . 'c.title AS section, \'2\' AS browsernav' ); // .'CONCAT_WS("/", c.title) AS section, \'2\' AS browsernav' ); $query->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); // Filter by language. if ($app->isSite() && 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'); } // Find an itemid for archived to use if there isn't another one. $item = $app->getMenu()->getItems('link', 'index.php?option=com_content&view=archive', true); $itemid = isset($item->id) ? '&Itemid=' . $item->id : ''; if (isset($list3)) { foreach ($list3 as $key => $item) { $date = JFactory::getDate($item->created); $created_month = $date->format("n"); $created_year = $date->format("Y"); $list3[$key]->href = JRoute::_('index.php?option=com_content&view=archive&year=' . $created_year . '&month=' . $created_month . $itemid); } } $rows[] = $list3; } $results = array(); if (count($rows)) { foreach ($rows as $row) { $new_row = array(); foreach ($row as $article) { if (SearchHelper::checkNoHtml($article, $searchText, array('text', 'title', 'metadesc', 'metakey'))) { $new_row[] = $article; } } $results = array_merge($results, (array) $new_row); } } foreach ($results as $article) { $pattern = su_get_shortcode_regex(); $article->text = preg_replace_callback('/' . $pattern . '/s', 'remove_callback', $article->text); } return $results; } public function onPrepareContent(&$row, &$params, $page = 0) { return $this->_prepareContent($row, $params, $page); } public function onContentPrepare($context, &$article, &$params, $page = 0) { //return $this->_prepareContent($article, $params, $page); if($context != "mod_custom.content"){ return $this->_prepareContent($article, $params, $page); } } protected function _prepareContent(&$article, &$params, $page = 0) { $article->text = preg_replace('/(\[(.*?)])(.*?)/s', '', $article->text); } } function remove_callback($m) { $pattern = su_get_shortcode_regex(); if (isset($m[5])) { // enclosing tag - extra parameter return preg_replace_callback('/' . $pattern . '/s', 'remove_callback', $m[5]); } else { // self-closing tag return ''; } } removeshortcode/removeshortcode.xml000064400000001313152325744550013720 0ustar00<?xml version="1.0" encoding="utf-8"?> <extension version="3.1" type="plugin" group="search" method="upgrade"> <name>Search - Remove Shortcode</name> <author>BdThemes Ltd</author> <creationDate>21 September 2017</creationDate> <authorEmail>info@bdthemes.com</authorEmail> <authorUrl>http://www.bdtheme.com</authorUrl> <copyright>(C) 2016 BDThemes Ltd. All rights reserved.</copyright> <license>http://www.gnu.org/copyright/gpl.html GNU/GPL</license> <version>1.1.0</version> <description>This plugin help you to remove all shortcode from your search result.</description> <files> <filename plugin="removeshortcode">removeshortcode.php</filename> <filename>index.html</filename> </files> </extension> tags/index.html000064400000000034152325744550007510 0ustar00<!DOCTYPE html><html></html>tags/tags.php000064400000013342152325744550007170 0ustar00<?php /** * @package Joomla.Plugin * @subpackage Search.tags * * @copyright (C) 2014 Open Source Matters, Inc. <https://www.joomla.org> * @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; } } } tags/tags.xml000064400000002630152325744550007177 0ustar00<?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>(C) 2014 Open Source Matters, Inc.</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> virtuemart/language/en-GB/en-GB.plg_search_virtuemart.ini000064400000000474152325744550017423 0ustar00; VirtueMart Project ; Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 PLG_SEARCH_VIRTUEMART="Search - VirtueMart" PLG_SEARCH_VIRTUEMART_PRODUCTS="Products"virtuemart/language/en-GB/en-GB.plg_search_virtuemart.sys.ini000064400000002772152325744550020243 0ustar00; VirtueMart Project ; Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 PLG_SEARCH_VIRTUEMART="Search - VirtueMart" PLG_SEARCH_VIRTUEMART_XML_DESCRIPTION="Allows searching of VirtueMart products including custom fields" PLG_SEARCH_VIRTUEMART_SEARCH_LIMIT="Search Limit" PLG_SEARCH_VIRTUEMART_SEARCH_LIMIT_DESC="Number of search items to return" PLG_SEARCH_VIRTUEMART_CUSTOMFIELDS="IDs of Custom Fields" PLG_SEARCH_VIRTUEMART_CUSTOMFIELDS_DESC="Enter the IDs of the fields you want to search (comma-separated). Leave blank to search all fields." PLG_SEARCH_VIRTUEMART_ENABLE_CF="Search Custom Fields" PLG_SEARCH_VIRTUEMART_ENABLE_CF_DESC="Whether Custom fields should be searched" PLG_SEARCH_VIRTUEMART_NO="No" PLG_SEARCH_VIRTUEMART_YES="Yes" PLG_SEARCH_VIRTUEMART_TITLE="Subtitle" PLG_SEARCH_VIRTUEMART_TITLE_DESC="The information shown in the search results below the title of the product." PLG_SEARCH_VIRTUEMART_TITLE_CATEGORY="Category Name" PLG_SEARCH_VIRTUEMART_TITLE_CATEGORY_CUSTOMTITLE="Category Custom Title" PLG_SEARCH_VIRTUEMART_ENABLE_DESC_SEARCH="Search product description" PLG_SEARCH_VIRTUEMART_ENABLE_DESC_SEARCH_DESC="Whether the product description should be searched" PLG_SEARCH_VIRTUEMART_ENABLE_S_DESC_SEARCH="Search product short description" PLG_SEARCH_VIRTUEMART_ENABLE_S_DESC_SEARCH_DESC="Whether the product short description should be searched"virtuemart/virtuemart.php000064400000020227152325744550011700 0ustar00<?php /** * * A search plugin for com_search * * @author Valérie Isaksen * @author Samuel Mehrbrodt * @author Franz-Peter Scherer * @version $Id: authorize.php 5122 2011-12-18 22:24:49Z alatak $ * @package VirtueMart * @subpackage search * @copyright Copyright (C) 2004-2008 soeren - All rights reserved. 2012 - 2017 The VirtueMart Team * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details. * * http://virtuemart.net */ // no direct access defined ('_JEXEC') or die('Restricted access'); defined('DS') or define('DS', DIRECTORY_SEPARATOR); // Get the product => categories. class plgSearchVirtuemart extends JPlugin { public function __construct(&$subject, $config) { parent::__construct($subject, $config); if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php'); VmConfig::loadConfig(); $this->loadLanguage(); } function onContentSearchAreas () { $this->loadLanguage(); static $areas = array( 'products' => 'PLG_SEARCH_VIRTUEMART_PRODUCTS' ); return $areas; } public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDbo(); if (is_array($areas)) { if (!array_intersect ($areas, array_keys ($this->onContentSearchAreas()))) { return array(); } } $limit = $this->params->get('search_limit', 50); switch($this->params->get('subtitledisplay', '1')) { case '1': $category_field = 'category_name'; break; case '2': $category_field = 'customtitle'; break; } $search_product_description = (bool) $this->params->get('enable_product_description_search', TRUE); $search_product_s_description = (bool) $this->params->get('enable_product_short_description_search', TRUE); $search_customfields = (bool) $this->params->get('enable_customfields', TRUE); $customfield_ids_condition = ""; if ($search_customfields) { $value = trim($this->params->get('customfields', "")); // Remove all spaces $value = str_replace(' ', '', $value); if (!empty($value)){ $customfield_ids = explode(",", $value); // Make sure we have only integers foreach($customfield_ids as &$id) { $id = intval($id); } // The custom field ID must be either in the list specified or NULL. $customfield_ids_condition = "AND cf.virtuemart_custom_id IN (" . implode(',', $customfield_ids) . ")"; } else { $search_customfields = false; } } $text = trim($text); if (empty($text)) return array(); switch ($phrase) { case 'exact': $text = $db->quote('%' . $db->escape($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'p.product_sku LIKE ' . $text; $wheres2[] = 'pd.product_name LIKE ' . $text; if ($search_product_s_description) $wheres2[] = 'pd.product_s_desc LIKE ' . $text; if ($search_product_description) $wheres2[] = 'pd.product_desc LIKE ' . $text; // $wheres2[] = 'pd.metadesc LIKE ' . $text; // $wheres2[] = 'pd.metakey LIKE ' . $text; if ($search_customfields) $wheres2[] = "(cf.customfield_value LIKE $text $customfield_ids_condition)"; $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[] = 'LOWER(pd.product_name) LIKE LOWER(' . $word . ')'; $wheres2[] = 'LOWER(p.product_sku) LIKE '.$word; if ($search_product_s_description) $wheres2[] = 'LOWER(pd.product_s_desc) LIKE LOWER(' . $word . ')'; if ($search_product_description) $wheres2[] = 'LOWER(pd.product_desc) LIKE LOWER(' . $word . ')'; // $wheres2[] = 'LOWER(pd.metadesc) LIKE LOWER(' . $word . ')'; // $wheres2[] = 'LOWER(pd.metakey) LIKE LOWER(' . $word . ')'; if ($search_customfields) $wheres2[] = 'cf.customfield_value LIKE LOWER(' . $word . ')'; $wheres[] = implode(' OR ', $wheres2); } $where = '(' . implode(($phrase === 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } switch ($ordering) { case 'oldest': $orderBy = 'created ASC'; break; case 'popular': $orderBy = 'hits DESC'; break; case 'alpha': $orderBy = 'pd.product_name ASC'; break; case 'category': $orderBy = 'cd.category_name ASC, a.product_name ASC'; case 'newest': $orderBy = 'created DESC'; break; default : $orderBy = 'product_id ASC'; break; } $shopper_group_condition=""; $currentVMuser = VmModel::getModel('user')->getCurrentUser(); $virtuemart_shoppergroup_ids = (array)$currentVMuser->shopper_groups; if (is_array($virtuemart_shoppergroup_ids)) { $sgrgroups = array(); foreach($virtuemart_shoppergroup_ids as $virtuemart_shoppergroup_id) { $sgrgroups[] = 'psgr.virtuemart_shoppergroup_id= "' . $virtuemart_shoppergroup_id . '" '; } $sgrgroups[] = 'psgr.virtuemart_shoppergroup_id IS NULL '; $shopper_group_condition = " AND ( " . implode (' OR ', $sgrgroups) . " ) "; } $uncategorized_products_condition = VmConfig::get('show_uncat_child_products') ? '' : ' AND c.virtuemart_category_id > 0 '; $query = " SELECT pd.virtuemart_product_id as product_id, " . " CONCAT( pd.product_name, ' (', p.product_sku, ')' ) AS title, pd.product_s_desc AS text, p.product_sales as hits, p.created_on AS created, cd.virtuemart_category_id as cat_id" . " FROM #__virtuemart_products AS p" . " INNER JOIN #__virtuemart_products_" . VmConfig::$vmlang . " AS pd ON pd.virtuemart_product_id = p.virtuemart_product_id " . " LEFT JOIN #__virtuemart_product_shoppergroups as psgr ON pd.virtuemart_product_id = psgr.virtuemart_product_id " . " LEFT JOIN #__virtuemart_product_categories as xref ON xref.virtuemart_product_id = pd.virtuemart_product_id " . " LEFT JOIN #__virtuemart_product_customfields AS cf ON pd.virtuemart_product_id = cf.virtuemart_product_id " . " LEFT JOIN #__virtuemart_categories as c ON c.virtuemart_category_id = xref.virtuemart_category_id " . " LEFT JOIN #__virtuemart_categories_" . VmConfig::$vmlang . " AS cd ON cd.virtuemart_category_id = c.virtuemart_category_id " . " WHERE ({$where}) " . " {$shopper_group_condition} " . " {$uncategorized_products_condition} " . " AND p.published = 1" . " GROUP BY title" . " ORDER BY {$orderBy}"; $db->setQuery($query, 0, $limit); $results = $db->loadObjectList(); $rs = array(); if (empty($results)) { return $rs; } foreach ($results as $result) { $c = self::getCategoryNames($result->product_id, $category_field); if (!empty($result->title)) { $result->title = html_entity_decode($result->title); } if (empty ($c->cat_id)) { $result->href = 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' .$result->product_id; } else { $result->href = 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' .$result->product_id . '&virtuemart_category_id=' . $c->cat_id; } $result->section = $c->cat_name; $result->browsernav = 2; $rs[] = $result; } return $rs; } protected static function getCategoryNames($id, $category_field) { $db = JFactory::getDbo(); $q = $db->getQuery(true); $q = "SELECT GROUP_CONCAT(cd." . $category_field . " separator ', ') as cat_name, c.virtuemart_category_id as cat_id " . " FROM #__virtuemart_product_categories AS cref " . " JOIN #__virtuemart_categories AS c " . " ON cref.virtuemart_category_id = c.virtuemart_category_id " . " JOIN #__virtuemart_categories_" . VmConfig::$vmlang . " AS cd " . " ON cd.virtuemart_category_id = cref.virtuemart_category_id " . " WHERE c.published = 1 AND cref.virtuemart_product_id = " . $id . " "; $db->setQuery($q); $category = $db->loadObject(); return $category; } } virtuemart/virtuemart.xml000064400000005344152325744550011714 0ustar00<?xml version="1.0" encoding="utf-8"?> <extension version="3.9" type="plugin" group="search" method="upgrade"> <name>Search - VirtueMart</name> <creationDate>August 11 2023</creationDate> <author>The VirtueMart Development Team</author> <authorUrl>https://virtuemart.net</authorUrl> <copyright>Copyright (C) 2004 - 2014 Virtuemart Team. All rights reserved.</copyright> <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license> <version>4.2.0</version> <description>PLG_SEARCH_VIRTUEMART_XML_DESCRIPTION</description> <files> <folder>language</folder> <filename plugin="virtuemart">virtuemart.php</filename> </files> <config> <fields name="params"> <fieldset name="basic"> <field name="search_limit" type="text" size="5" default="50" filter="integer" label="PLG_SEARCH_VIRTUEMART_SEARCH_LIMIT" description="PLG_SEARCH_VIRTUEMART_SEARCH_LIMIT_DESC" /> <field name="enable_product_description_search" type="radio" default="1" label="PLG_SEARCH_VIRTUEMART_ENABLE_DESC_SEARCH" description="PLG_SEARCH_VIRTUEMART_ENABLE_DESC_SEARCH_DESC"> <option value="1">PLG_SEARCH_VIRTUEMART_YES</option> <option value="0">PLG_SEARCH_VIRTUEMART_NO</option> </field> <field name="enable_product_short_description_search" type="radio" default="1" label="PLG_SEARCH_VIRTUEMART_ENABLE_S_DESC_SEARCH" description="PLG_SEARCH_VIRTUEMART_ENABLE_S_DESC_SEARCH_DESC"> <option value="1">PLG_SEARCH_VIRTUEMART_YES</option> <option value="0">PLG_SEARCH_VIRTUEMART_NO</option> </field> <field name="enable_customfields" type="radio" default="1" label="PLG_SEARCH_VIRTUEMART_ENABLE_CF" description="PLG_SEARCH_VIRTUEMART_ENABLE_CF_DESC"> <option value="1">PLG_SEARCH_VIRTUEMART_YES</option> <option value="0">PLG_SEARCH_VIRTUEMART_NO</option> </field> <field name="customfields" type="text" size="10" label="PLG_SEARCH_VIRTUEMART_CUSTOMFIELDS" description="PLG_SEARCH_VIRTUEMART_CUSTOMFIELDS_DESC" /> <field name="subtitledisplay" type="list" label="PLG_SEARCH_VIRTUEMART_TITLE" description="PLG_SEARCH_VIRTUEMART_TITLE_DESC"> <option value="1">PLG_SEARCH_VIRTUEMART_TITLE_CATEGORY</option> <option value="2">PLG_SEARCH_VIRTUEMART_TITLE_CATEGORY_CUSTOMTITLE</option> </field> </fieldset> </fields> </config> <updateservers> <!-- Note: No spaces or linebreaks allowed between the server tags --> <server type="extension" name="VirtueMart3 plg_search_virtuemart Update Site"><![CDATA[http://virtuemart.net/releases/vm3/plg_search_virtuemart_update.xml]]></server> </updateservers> </extension> weblinks/language/en-GB/en-GB.plg_search_weblinks.ini000064400000001020152325744550016437 0ustar00; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 PLG_SEARCH_WEBLINKS="Search - Web Links" PLG_SEARCH_WEBLINKS_FIELD_SEARCHLIMIT_DESC="Number of search items to return." PLG_SEARCH_WEBLINKS_FIELD_SEARCHLIMIT_LABEL="Search Limit" PLG_SEARCH_WEBLINKS_WEBLINKS="Web Links" PLG_SEARCH_WEBLINKS_XML_DESCRIPTION="Enables searching of Web Links Component." weblinks/language/en-GB/en-GB.plg_search_weblinks.sys.ini000064400000000535152325744550017266 0ustar00; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 PLG_SEARCH_WEBLINKS="Search - Web Links" PLG_SEARCH_WEBLINKS_XML_DESCRIPTION="Enables searching of Web Links Component." weblinks/weblinks.php000064400000012371152325744550010731 0ustar00<?php /** * @package Joomla.Plugin * @subpackage Search.weblinks * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE . '/components/com_weblinks/helpers/route.php'; /** * Weblinks search plugin. * * @since 1.6 */ class PlgSearchWeblinks 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( 'weblinks' => 'PLG_SEARCH_WEBLINKS_WEBLINKS' ); return $areas; } /** * Search content (weblinks). * * 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(); $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels()); $searchText = $text; if (is_array($areas)) { if (!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(); } $searchWeblinks = JText::_('PLG_SEARCH_WEBLINKS'); switch ($phrase) { case 'exact': $text = $db->quote('%' . $db->escape($text, true) . '%', false); $wheres2 = array(); $wheres2[] = 'a.url LIKE ' . $text; $wheres2[] = 'a.description LIKE ' . $text; $wheres2[] = 'a.title 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.url LIKE ' . $word; $wheres2[] = 'a.description LIKE ' . $word; $wheres2[] = 'a.title LIKE ' . $word; $wheres[] = implode(' OR ', $wheres2); } $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'; } $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.title AS title, \'\' AS created, a.url, a.description AS text, ' . $case_when . "," . $case_when1) ->select($query->concatenate(array($db->quote($searchWeblinks), 'c.title'), " / ") . ' AS section') ->select('\'1\' AS browsernav') ->from('#__weblinks AS a') ->join('INNER', '#__categories as c ON c.id = a.catid') ->where('(' . $where . ') AND a.state IN (' . implode(',', $state) . ') AND c.published = 1 AND c.access IN (' . $groups . ')') ->order($order); // Filter by language. if (JFactory::getApplication()->isSite() && 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); $rows = $db->loadObjectList(); $return = array(); if ($rows) { foreach ($rows as $key => $row) { $rows[$key]->href = WeblinksHelperRoute::getWeblinkRoute($row->slug, $row->catslug); } foreach ($rows as $weblink) { if (searchHelper::checkNoHTML($weblink, $searchText, array('url', 'text', 'title'))) { $return[] = $weblink; } } } return $return; } } weblinks/weblinks.xml000064400000003013152325744550010733 0ustar00<?xml version="1.0" encoding="utf-8"?> <extension version="3.1" type="plugin" group="search" method="upgrade"> <name>plg_search_weblinks</name> <author>Joomla! Project</author> <creationDate>November 2005</creationDate> <copyright>Copyright (C) 2005 - 2015 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.4.1</version> <description>PLG_SEARCH_WEBLINKS_XML_DESCRIPTION</description> <files> <filename plugin="weblinks">weblinks.php</filename> <folder>language</folder> </files> <config> <fields name="params"> <fieldset name="basic"> <field name="search_limit" type="text" default="50" description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC" label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL" size="5" /> <field name="search_content" type="radio" class="btn-group btn-group-yesno" default="0" description="JFIELD_PLG_SEARCH_ALL_DESC" label="JFIELD_PLG_SEARCH_ALL_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> <field name="search_archived" type="radio" class="btn-group btn-group-yesno" default="0" description="JFIELD_PLG_SEARCH_ARCHIVED_DESC" label="JFIELD_PLG_SEARCH_ARCHIVED_LABEL" > <option value="1">JON</option> <option value="0">JOFF</option> </field> </fieldset> </fields> </config> </extension> index.html000064400000000037152325744550006555 0ustar00<!DOCTYPE html><title></title>
/home/digilove/public_html/f7525/../libraries/../41423/search.tar