diff --git a/getLastNews.php b/getLastNews.php new file mode 100644 index 0000000..155a127 --- /dev/null +++ b/getLastNews.php @@ -0,0 +1,27 @@ +channel->item as $value) { + $dk = date($value->pubDate); + $news[$dk] = $value; + } + + ksort($news); + $c = 0; + + foreach ($news as $new) { + $c++; + if($c<6){ + +echo $new->title.' +'; +echo $new->link.' +'; +echo $new->description.' +'; + } + } + +?> \ No newline at end of file diff --git a/local/php_inteface/classes/helpers/infoblocks.php b/local/php_inteface/classes/helpers/infoblocks.php new file mode 100644 index 0000000..d34653e --- /dev/null +++ b/local/php_inteface/classes/helpers/infoblocks.php @@ -0,0 +1,60 @@ +50) : $nPageSize = $arBlock['PAGE_SIZE']; + + $key = md5(json_encode($arBlock)); + + $obCache = \Bitrix\Main\Data\Cache::createInstance(); + $cache_time = $cashtime; + $cache_id = 'ModuleInfoBlocks_'.$key; + + if( $obCache->initCache($cache_time,$cache_id,'/ModuleInfoBlocks/') ) + { + $arResult = $obCache->GetVars(); + + } + elseif($obCache->startDataCache()) + { + + $res = CIBlockElement::GetList( + $arOreder, + $arFilter, + $arGroup, + $nPageSize, + $arSelect + ); + + + while($ob = $res->GetNextElement()) + { + $arFields = $ob->GetFields(); + $arProps = $ob->GetProperties(); + + $arResult[$arFields['ID']]['FIELDS'] = $arFields; + $arResult[$arFields['ID']]['PROP'] = $arProps; + + } + + $obCache->endDataCache($arResult); + + } + return $arResult; + } + +} + +?> \ No newline at end of file