예제 #1
0
if (!is_array($arParams["IBLOCKS"])) {
    $arParams["IBLOCKS"] = array($arParams["IBLOCKS"]);
}
$arIBlockFilter = array();
foreach ($arParams["IBLOCKS"] as $IBLOCK_ID) {
    $IBLOCK_ID = intval($IBLOCK_ID);
    if ($IBLOCK_ID > 0) {
        $arIBlockFilter[] = $IBLOCK_ID;
    }
}
if (count($arIBlockFilter) <= 0) {
    if (!CModule::IncludeModule("iblock")) {
        ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
        return;
    }
    $rsIBlocks = GetIBlockList($arParams["IBLOCK_TYPE"]);
    if ($arIBlock = $rsIBlocks->GetNext()) {
        $arIBlockFilter[] = $arIBlock["ID"];
    }
}
unset($arParams["IBLOCK_TYPE"]);
$arParams["PARENT_SECTION"] = intval($arParams["PARENT_SECTION"]);
$arParams["IBLOCKS"] = $arIBlockFilter;
if (count($arIBlockFilter) > 0 && $this->StartResultCache(false, $arParams["CACHE_GROUPS"] === "N" ? false : $USER->GetGroups())) {
    if (!CModule::IncludeModule("iblock")) {
        $this->AbortResultCache();
        ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
        return;
    }
    //SELECT
    $arSelect = array("ID", "IBLOCK_ID", "CODE", "IBLOCK_SECTION_ID", "NAME", "PREVIEW_PICTURE", "DETAIL_PICTURE", "DETAIL_PAGE_URL", "PROPERTY_PRICE", "PROPERTY_PRICECURRENCY");
예제 #2
0
$NEWS_COUNT = strlen($NEWS_COUNT) > 0 ? intval($NEWS_COUNT) : "5";
$SORT_BY1 = isset($SORT_BY1) ? $SORT_BY1 : "ACTIVE_FROM";
$SORT_ORDER1 = isset($SORT_ORDER1) ? $SORT_ORDER1 : "DESC";
$SORT_BY2 = isset($SORT_BY2) ? $SORT_BY2 : "SORT";
$SORT_ORDER2 = isset($SORT_ORDER2) ? $SORT_ORDER2 : "ASC";
$SORT = array($SORT_BY1 => $SORT_ORDER1, $SORT_BY2 => $SORT_ORDER2);
$CACHE_TIME = intval($CACHE_TIME);
$CACHE_ID = SITE_ID . "|" . $APPLICATION->GetCurPage() . "|" . md5(serialize($arParams)) . "|" . $USER->GetGroups();
$APPLICATION->SetTitle(GetMessage("T_NEWS_INDEX_TITLE"));
$cache = new CPageCache();
if ($cache->StartDataCache($CACHE_TIME, $CACHE_ID)) {
    if (!CModule::IncludeModule("iblock")) {
        echo ShowError(GetMessage("T_NEWS_INDEX_MODULE_NA"));
    } else {
        //if(!CModule::IncludeModule("iblock")):
        $iblocks = GetIBlockList($IBLOCK_TYPE, array(), array(), $IBLOCK_SORT);
        while ($arIBlock = $iblocks->GetNext()) {
            ?>
			<font class="text">
			<a href="<?php 
            echo $arIBlock["LIST_PAGE_URL"];
            ?>
"><b><?php 
            echo $arIBlock["NAME"];
            ?>
</b></a><br><br></font>
			<?php 
            $items = GetIBlockElementList($arIBlock["ID"], false, $SORT, $NEWS_COUNT);
            ?>
			<table cellpadding="2" cellspacing="0" border="0" width="80%">
				<?php 
예제 #3
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (CModule::IncludeModule("iblock")) {
    global $APPLICATION;
    $aMenuLinksExt = array();
    $iblocks = GetIBlockList("furniture", array(), array(), array("sort" => "asc"));
    while ($arResult = $iblocks->GetNext()) {
        $aMenuLinksExt = $APPLICATION->IncludeComponent("bitrix:menu.sections", "", array("ID" => $_REQUEST["ELEMENT_ID"], "IBLOCK_TYPE" => "furniture", "IBLOCK_ID" => $arResult["ID"], "SECTION_URL" => $arResult["LIST_PAGE_URL"] . "/?SECTION_ID=#ID#", "DEPTH_LEVEL" => "2", "CACHE_TIME" => "3600"));
        $aMenuLinks = array_merge($aMenuLinks, $aMenuLinksExt);
    }
}
?>