From 4950a37b58d9a6c1e5a9456e94b9a5fcfb6c9295 Mon Sep 17 00:00:00 2001 From: mprokhorov Date: Thu, 29 Aug 2019 11:12:09 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=8D?= =?UTF-8?q?=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=D0=BE=D0=B2=20=D0=B8=D0=BD?= =?UTF-8?q?=D1=84=D0=BE=D0=B1=D0=BB=D0=BE=D0=BA=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IBlockTools.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 IBlockTools.php diff --git a/IBlockTools.php b/IBlockTools.php new file mode 100644 index 0000000..bb12322 --- /dev/null +++ b/IBlockTools.php @@ -0,0 +1,43 @@ +initCache(3600, $cacheId)) { + return $cache->getVars(); + } elseif ($cache->startDataCache(3600, $cacheId, '/' . SITE_ID . '/' . 'cachedElements')) { + $sort = $params['sort'] ? : array('SORT' => 'ASC'); + $filter = $params['filter'] ? : array(); + $select = $params['select'] ? : array(); + $result = array(); + $dbElements = CIBlockElement::GetList( + $sort, + $filter, + false, + false, + $select + ); + while ($element = $dbElements->Fetch()) { + $result[] = $element; + } + $cache->endDataCache($result); + return $result; + } + } +} From 65b4c1ba30a7254ec4280c79ab5abd9944458f4a Mon Sep 17 00:00:00 2001 From: mprokhorov Date: Thu, 29 Aug 2019 11:12:27 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BD=D0=BE=D0=B2=D0=BE=D1=81=D1=82=D0=B5=D0=B9=20=D1=81=20?= =?UTF-8?q?lenta.ru?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- getLastNews.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 getLastNews.php diff --git a/getLastNews.php b/getLastNews.php new file mode 100644 index 0000000..281c3ca --- /dev/null +++ b/getLastNews.php @@ -0,0 +1,36 @@ +#!/usr/bin/php +xpath('//item') as $news) { + if ($newsCounter < $newsLimit) { + printf("%u. %s\r\n", $newsCounter + 1, str_repeat('=', 50)); + printf("%s\r\n", htmlspecialchars(strip_tags(trim((string) $news->title)))); + printf("%s\r\n", htmlspecialchars(strip_tags(trim((string) $news->link)))); + printf("%s\r\n", htmlspecialchars(strip_tags(trim(((string) $news->description))))); + printf("%s\r\n", str_repeat('=', 50)); + echo "\r\n"; + $newsCounter++; + } else { + break; + } +} +foreach ($result as $item) { + +} + +require($_SERVER["DOCUMENT_ROOT"] . "bitrix/modules/main/include/epilog_after.php"); +?>