$arFilter2 = array(); if (!empty($arParams["FID_RANGE"]) || !empty($arParams["FID"])) { $arFilter2["PARAM1"] = empty($arParams["FID_RANGE"]) ? array() : array_keys($arResult["FORUMS"]); $arFilter2["PARAM1"] = empty($arParams["FID"]) ? $arFilter2["PARAM1"] : $arParams["FID"]; } $obSearch = new CSearch(); //When restart option is set we will ignore error on query with only stop words $obSearch->SetOptions(array("ERROR_ON_EMPTY_STEM" => $arParams["RESTART"] != "Y", "NO_WORD_LOGIC" => $arParams["NO_WORD_LOGIC"] == "Y")); $obSearch->Search($arFilter1, $aSort, array($arFilter2)); if ($obSearch->errorno != 0) { $arResult["ERROR_MESSAGE"] = $obSearch->error; } else { $obSearch->NavStart($arParams["TOPICS_PER_PAGE"], false); $obSearch->nPageWindow = $arParams["PAGE_NAVIGATION_WINDOW"]; $arResult["NAV_RESULT"] = $obSearch; $arResult["NAV_STRING"] = $obSearch->GetPageNavStringEx($navComponentObject, GetMessage("FL_TOPIC_LIST"), $arParams["PAGE_NAVIGATION_TEMPLATE"]); $arResult["EMPTY"] = "Y"; $topics = array(); if ($res = $obSearch->GetNext()) { $arResult["order"]["~relevance"] = $APPLICATION->GetCurPageParam("q=" . urlencode($q) . (!empty($arParams["FID"]) ? "&FORUM_ID=" . $arParams["FID"] : ""), array("FORUM_ID", "q", "order", "s", BX_AJAX_PARAM_ID)); $arResult["order"]["~topic"] = $APPLICATION->GetCurPageParam("q=" . urlencode($q) . (!empty($arParams["FID"]) ? "&FORUM_ID=" . $arParams["FID"] : "") . "&order=topic", array("FORUM_ID", "q", "order", "s", BX_AJAX_PARAM_ID)); $arResult["order"]["~date"] = $APPLICATION->GetCurPageParam("q=" . urlencode($q) . (!empty($arParams["FID"]) ? "&FORUM_ID=" . $arParams["FID"] : "") . "&order=date", array("FORUM_ID", "q", "order", "s", BX_AJAX_PARAM_ID)); $arResult["order"]["relevance"] = htmlspecialcharsbx($arResult["order"]["~relevance"]); $arResult["order"]["topic"] = htmlspecialcharsbx($arResult["order"]["~topic"]); $arResult["order"]["date"] = htmlspecialcharsbx($arResult["order"]["~date"]); $arResult["EMPTY"] = "N"; do { if (intVal($res["ITEM_ID"]) > 0) { $res["URL"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("FID" => $res["PARAM1"], "TID" => $res["PARAM2"], "TITLE_SEO" => $res["PARAM2"], "MID" => $res["ITEM_ID"])); $res["~URL"] = CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("FID" => $res["PARAM1"], "TID" => $res["PARAM2"], "TITLE_SEO" => $res["PARAM2"], "MID" => $res["ITEM_ID"])); } else {
if (!empty($ar["~TAGS_FORMATED"])) { foreach ($ar["~TAGS_FORMATED"] as $name => $tag) { if ($arParams["TAGS_INHERIT"] == "Y") { $arTags = $arResult["REQUEST"]["~TAGS_ARRAY"]; $arTags[$tag] = $tag; $tags = implode(",", $arTags); } else { $tags = $tag; } $ar["TAGS"][] = array("URL" => $APPLICATION->GetCurPageParam("tags=" . urlencode($tags), array("tags")), "TAG_NAME" => htmlspecialcharsex($name)); } } $arResult["SEARCH"][] = $ar; $ar = $obSearch->GetNext(); } $arResult["NAV_STRING"] = $obSearch->GetPageNavStringEx($navComponentObject, $arParams["PAGER_TITLE"], $arParams["PAGER_TEMPLATE"], $arParams["PAGER_SHOW_ALWAYS"]); $arResult["NAV_CACHED_DATA"] = $navComponentObject->GetTemplateCachedData(); $arResult["NAV_RESULT"] = $obSearch; } $arResult["TAGS_CHAIN"] = array(); $url = array(); foreach ($arResult["REQUEST"]["~TAGS_ARRAY"] as $key => $tag) { $url_without = $arResult["REQUEST"]["~TAGS_ARRAY"]; unset($url_without[$key]); $url[$tag] = $tag; $result = array("TAG_NAME" => $tag, "TAG_PATH" => $APPLICATION->GetCurPageParam("tags=" . urlencode(implode(",", $url)), array("tags")), "TAG_WITHOUT" => $APPLICATION->GetCurPageParam("tags=" . urlencode(implode(",", $url_without)), array("tags"))); $arResult["TAGS_CHAIN"][] = $result; } $this->ShowComponentTemplate(); } } else {