Код |
---|
$arResult['ITEMS'] = array(); while($arItem = $rsIBlockElement->GetNext()) { $arImg = CFile::GetFileArray($arItem['PREVIEW_PICTURE']); if(empty($arImg)) { $arImg = CFile::GetFileArray($arItem['DETAIL_PICTURE']); } if(!empty($arImg)) { $arItem['PICTURE'] = $arImg; $arResult['ITEMS'][] = $arItem; } } if(!empty($arResult['ITEMS'])) { $this->SetResultCacheKeys(array( )); $this->IncludeComponentTemplate(); } else { $this->AbortResultCache(); } |
Код |
---|
if(!empty($arResult['ITEMS']) && is_array($arResult['ITEMS'])) { foreach($arResult['ITEMS'] as $arItem) { ?><div class="photo-random"><? ?><a href="<?=$arItem['DETAIL_PAGE_URL']?>"><? ?><img src="<?=$arItem['PICTURE']['SRC']?>" width="<?=$arItem['PICTURE']['WIDTH']?>" height="<?=$arItem['PICTURE']['HEIGHT']?>" alt="<?=$arItem['NAME']?>" title="" /><? ?></a><br /><? ?><a href="<?=$arItem['DETAIL_PAGE_URL']?>"><?=$arItem['NAME']?></a><? ?></div><? } } |