當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSearch::GetPageNavString方法代碼示例

本文整理匯總了PHP中CSearch::GetPageNavString方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSearch::GetPageNavString方法的具體用法?PHP CSearch::GetPageNavString怎麽用?PHP CSearch::GetPageNavString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CSearch的用法示例。


在下文中一共展示了CSearch::GetPageNavString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

if (strlen($arResult["~where"]) > 0) {
    $arFilter["PARAM1"] = $arResult["~where"];
}
if ($arResult["~how"] == "d") {
    $aSort = array("DATE_CHANGE" => "DESC", "CUSTOM_RANK" => "DESC", "RANK" => "DESC");
} else {
    $aSort = array("CUSTOM_RANK" => "DESC", "RANK" => "DESC", "DATE_CHANGE" => "DESC");
}
$arResult["SEARCH_RESULT"] = array();
if (strlen($arResult["~q"]) > 0 || strlen($arResult["~tags"]) > 0) {
    $obSearch = new CSearch();
    $obSearch->Search($arFilter, $aSort);
    $arResult["SEARCH_RESULT"] = array();
    if ($obSearch->errorno == 0) {
        $obSearch->NavStart($arParams["PAGE_RESULT_COUNT"]);
        $arResult["NAV_STRING"] = $obSearch->GetPageNavString(GetMessage("BMS_PAGES"), $arParams["NAV_TEMPLATE"], false, $component);
        while ($arSearch = $obSearch->GetNext()) {
            if ($arSearch["PARAM1"] == "POST") {
                $Blog = CBlog::GetByID($arSearch["PARAM2"]);
                $Blog = CBlogTools::htmlspecialcharsExArray($Blog);
                $arSearch["PARAM2"] = $Blog["OWNER_ID"];
                $arSearch["BLOG_URL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $Blog["URL"]));
                $arSearch["USER_URL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $Blog["OWNER_ID"]));
                $arSearch["URL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $Blog["URL"], "post_id" => substr($arSearch["ITEM_ID"], 1)));
            } elseif ($arSearch["PARAM1"] == "USER") {
                $arSearch["URL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arSearch["PARAM2"]));
            } elseif ($arSearch["PARAM1"] == "BLOG") {
                $Blog = CBlog::GetByID(substr($arSearch["ITEM_ID"], 1));
                $Blog = CBlogTools::htmlspecialcharsExArray($Blog);
                $arSearch["URL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $Blog["URL"]));
            } elseif ($arSearch["PARAM1"] == "COMMENT") {
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:component.php

示例2: array

	$arFilter["PARAM1"] = "C".$arParams["COURSE_ID"];
}
*/
if ($arResult["~how"] == "d") {
    $aSort = array("DATE_CHANGE" => "DESC", "CUSTOM_RANK" => "DESC", "RANK" => "DESC");
} else {
    $aSort = array("CUSTOM_RANK" => "DESC", "RANK" => "DESC", "DATE_CHANGE" => "DESC");
}
$arResult["SEARCH_RESULT"] = array();
if (strlen($arResult["~q"]) > 0 || strlen($arResult["~tags"]) > 0) {
    $obSearch = new CSearch();
    $obSearch->Search($arFilter, $aSort);
    $arResult["SEARCH_RESULT"] = array();
    if ($obSearch->errorno == 0) {
        $obSearch->NavStart($arParams["PAGE_RESULT_COUNT"]);
        $arResult["NAV_STRING"] = $obSearch->GetPageNavString(GetMessage("LEARNING_RESULT_PAGES"), $arParams["NAV_TEMPLATE"]);
        while ($arSearch = $obSearch->GetNext()) {
            $arResult["SEARCH_RESULT"][] = $arSearch;
        }
        if (count($arResult["SEARCH_RESULT"]) > 0) {
            if (strlen($arResult["~tags"]) > 0) {
                $arResult["ORDER_LINK"] = $APPLICATION->GetCurPageParam("tags=" . urlencode($arResult["tags"]) . "&where=" . urlencode($arResult["where"]), array("tags", "where", "how"));
            } else {
                $arResult["ORDER_LINK"] = $APPLICATION->GetCurPageParam("q=" . urlencode($arResult["q"]) . "&where=" . urlencode($arResult["where"]), array("q", "where", "how"));
            }
            if ($arResult["~how"] != "d") {
                $arResult["ORDER_LINK"] .= "&how=d";
            }
        } else {
            $arResult["ERROR_MESSAGE"] = GetMessage("LEARNING_MAIN_SEARCH_NOTHING_FOUND");
        }
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:component.php


注:本文中的CSearch::GetPageNavString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。