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


PHP CIBlockElement::GetShowedFunction方法代碼示例

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


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

示例1: PrepareGetList

 function PrepareGetList(&$arIblockElementFields, &$arJoinProps, &$bOnlyCount, &$bDistinct, &$arSelectFields, &$sSelect, &$arAddSelectFields, &$arFilter, &$sWhere, &$sSectionWhere, &$arAddWhereFields, &$arGroupBy, &$sGroupBy, &$arOrder, &$arSqlOrder, &$arAddOrderByFields, &$arIBlockFilter, &$arIBlockMultProps, &$arIBlockConvProps, &$arIBlockAllProps, &$arIBlockNumProps, &$arIBlockLongProps)
 {
     if (is_array($arSelectFields) && (in_array("DETAIL_PAGE_URL", $arSelectFields) || in_array("CANONICAL_PAGE_URL", $arSelectFields)) && !in_array("LANG_DIR", $arSelectFields)) {
         $arSelectFields[] = "LANG_DIR";
     }
     global $DB, $USER;
     if (!is_array($arSelectFields) && $arSelectFields == "" || count($arSelectFields) <= 0 || $arSelectFields === false) {
         $arSelectFields = array("*");
     }
     if (is_bool($arGroupBy) && $arGroupBy !== false) {
         $arGroupBy = array();
     }
     if (is_array($arGroupBy) && count($arGroupBy) == 0) {
         $bOnlyCount = true;
     }
     $iPropCnt = 0;
     $arJoinProps = array("FP" => array(), "FPV" => array(), "FPS" => array(), "FPEN" => array(), "BE" => array(), "BE_FP" => array(), "BE_FPV" => array(), "BE_FPS" => array(), "BE_FPEN" => array(), "BES" => "", "RV" => false, "RVU" => false, "RVV" => false, "FC" => "");
     $arIBlockMultProps = array();
     $arIBlockAllProps = array();
     $arIBlockNumProps = array();
     $bWasGroup = false;
     //********************************ORDER BY PART***********************************************
     $arSqlOrder = array();
     $arAddOrderByFields = array();
     $iOrdNum = -1;
     if (!is_array($arOrder)) {
         $arOrder = array();
     }
     foreach ($arOrder as $by => $order) {
         $by_orig = $by;
         $by = strtoupper($by);
         //Remove aliases
         if ($by == "EXTERNAL_ID") {
             $by = "XML_ID";
         } elseif ($by == "DATE_ACTIVE_FROM") {
             $by = "ACTIVE_FROM";
         } elseif ($by == "DATE_ACTIVE_TO") {
             $by = "ACTIVE_TO";
         }
         if (array_key_exists($by, $arSqlOrder)) {
             continue;
         }
         if (substr($by, 0, 8) == "CATALOG_") {
             $iOrdNum++;
             $arAddOrderByFields[$iOrdNum] = array($by => $order);
             //Reserve for future fill
             $arSqlOrder[$iOrdNum] = false;
         } else {
             if ($by == "ID") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.ID", $order, "desc", false);
             } elseif ($by == "NAME") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.NAME", $order, "desc", false);
             } elseif ($by == "STATUS") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.WF_STATUS_ID", $order, "desc");
             } elseif ($by == "XML_ID") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.XML_ID", $order, "desc");
             } elseif ($by == "CODE") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.CODE", $order, "desc");
             } elseif ($by == "TAGS") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.TAGS", $order, "desc");
             } elseif ($by == "TIMESTAMP_X") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.TIMESTAMP_X", $order, "desc");
             } elseif ($by == "CREATED") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.DATE_CREATE", $order, "desc");
             } elseif ($by == "CREATED_DATE") {
                 $arSqlOrder[$by] = CIBlock::_Order($DB->DateFormatToDB("YYYY.MM.DD", "BE.DATE_CREATE"), $order, "desc");
             } elseif ($by == "IBLOCK_ID") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.IBLOCK_ID", $order, "desc");
             } elseif ($by == "MODIFIED_BY") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.MODIFIED_BY", $order, "desc");
             } elseif ($by == "CREATED_BY") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.CREATED_BY", $order, "desc");
             } elseif ($by == "ACTIVE") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.ACTIVE", $order, "desc");
             } elseif ($by == "ACTIVE_FROM") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.ACTIVE_FROM", $order, "desc");
             } elseif ($by == "ACTIVE_TO") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.ACTIVE_TO", $order, "desc");
             } elseif ($by == "SORT") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.SORT", $order, "desc");
             } elseif ($by == "IBLOCK_SECTION_ID") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.IBLOCK_SECTION_ID", $order, "desc");
             } elseif ($by == "SHOW_COUNTER") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.SHOW_COUNTER", $order, "desc");
             } elseif ($by == "SHOW_COUNTER_START") {
                 $arSqlOrder[$by] = CIBlock::_Order("BE.SHOW_COUNTER_START", $order, "desc");
             } elseif ($by == "RAND") {
                 $arSqlOrder[$by] = CIBlockElement::GetRandFunction(true);
             } elseif ($by == "SHOWS") {
                 $arSqlOrder[$by] = CIBlock::_Order(CIBlockElement::GetShowedFunction(), $order, "desc", false);
             } elseif ($by == "HAS_PREVIEW_PICTURE") {
                 $arSqlOrder[$by] = CIBlock::_Order(CIBlock::_NotEmpty("BE.PREVIEW_PICTURE"), $order, "desc", false);
             } elseif ($by == "HAS_DETAIL_PICTURE") {
                 $arSqlOrder[$by] = CIBlock::_Order(CIBlock::_NotEmpty("BE.DETAIL_PICTURE"), $order, "desc", false);
             } elseif ($by == "RATING_TOTAL_VALUE") {
                 $arSqlOrder[$by] = CIBlock::_Order("RV.TOTAL_VALUE", $order, "desc");
                 $arJoinProps["RV"] = true;
             } elseif ($by == "CNT") {
                 if (is_array($arGroupBy) && count($arGroupBy) > 0) {
                     $arSqlOrder[$by] = " CNT " . $order . " ";
//.........這裏部分代碼省略.........
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:101,代碼來源:iblockelement.php


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