Created
April 16, 2015 13:40
-
-
Save iredun/0075809def4fa06434c0 to your computer and use it in GitHub Desktop.
Скрипт удаляет все старые элементы инфоблока
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$arSelect = Array("ID", "NAME", "TIMESTAMP_X"); | |
$arFilter = Array("IBLOCK_ID"=>"21", "<TIMESTAMP_X"=>"31.12.2013 23:59:59"); | |
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>1000), $arSelect); | |
echo $res->SelectedRowsCount(); | |
while($ob = $res->GetNextElement()) | |
{ | |
echo "<pre>"; | |
$arFields = $ob->GetFields(); | |
print_r($arFields); | |
CIBlockElement::Delete($arFields["ID"]); | |
echo "</pre>"; | |
} | |
$navString = $res->GetPageNavStringEx($navComponentObject, "подпись пагинатора", "шаблон пагинатора", "флаг показывать всегда"); | |
echo $navString; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment