%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 3.144.14.150 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/components/bitrix/photo.random/ |
Upload File : |
<? if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); /** @var CBitrixComponent $this */ /** @var array $arParams */ /** @var array $arResult */ /** @var string $componentPath */ /** @var string $componentName */ /** @var string $componentTemplate */ /** @global CDatabase $DB */ /** @global CUser $USER */ /** @global CMain $APPLICATION */ /************************************************************************* Processing of received parameters *************************************************************************/ if(!isset($arParams["CACHE_TIME"])) $arParams["CACHE_TIME"] = 180; 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(empty($arIBlockFilter)) { if(!CModule::IncludeModule("iblock")) { ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED")); return; } $rsIBlocks = CIBlock::GetList(array("sort" => "asc"), array( "type" => $arParams["IBLOCK_TYPE"], "LID" => SITE_ID, "ACTIVE" => "Y", )); if($arIBlock = $rsIBlocks->Fetch()) $arIBlockFilter[] = $arIBlock["ID"]; } unset($arParams["IBLOCK_TYPE"]); $arParams["PARENT_SECTION"] = intval($arParams["PARENT_SECTION"]); $arParams["IBLOCKS"] = $arIBlockFilter; if(!empty($arIBlockFilter) && $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", ); //WHERE $arFilter = array( "IBLOCK_ID" => $arParams["IBLOCKS"], "ACTIVE_DATE" => "Y", "ACTIVE"=>"Y", "CHECK_PERMISSIONS"=>"Y", ); if($arParams["PARENT_SECTION"]>0) { $arFilter["SECTION_ID"] = $arParams["PARENT_SECTION"]; $arFilter["INCLUDE_SUBSECTIONS"] = "Y"; } //ORDER BY $arSort = array( "RAND"=>"ASC", ); //EXECUTE $rsIBlockElement = CIBlockElement::GetList($arSort, $arFilter, false, false, $arSelect); $rsIBlockElement->SetUrlTemplates($arParams["DETAIL_URL"]); if($arResult = $rsIBlockElement->GetNext()) { $arResult["PICTURE"] = CFile::GetFileArray($arResult["PREVIEW_PICTURE"]); if(!is_array($arResult["PICTURE"])) $arResult["PICTURE"] = CFile::GetFileArray($arResult["DETAIL_PICTURE"]); $ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues($arResult["IBLOCK_ID"], $arResult["ID"]); $arResult["IPROPERTY_VALUES"] = $ipropValues->getValues(); if ($arResult["PICTURE"]) { $arResult["PICTURE"]["ALT"] = $arResult["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_ALT"]; if ($arResult["PICTURE"]["ALT"] == "") $arResult["PICTURE"]["ALT"] = $arResult["NAME"]; $arResult["PICTURE"]["TITLE"] = $arResult["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_TITLE"]; if ($arResult["PICTURE"]["TITLE"] == "") $arResult["PICTURE"]["TITLE"] = $arResult["NAME"]; } $this->SetResultCacheKeys(array( )); $this->IncludeComponentTemplate(); } else { $this->AbortResultCache(); } } ?>