本文整理汇总了PHP中CSearch::GetPageNavStringEx方法的典型用法代码示例。如果您正苦于以下问题:PHP CSearch::GetPageNavStringEx方法的具体用法?PHP CSearch::GetPageNavStringEx怎么用?PHP CSearch::GetPageNavStringEx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSearch
的用法示例。
在下文中一共展示了CSearch::GetPageNavStringEx方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$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 {
示例2: foreach
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 {