当前位置: 首页>>代码示例>>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;未经允许,请勿转载。