<?
$arSelect = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM","PROPERTY_*");//IBLOCK_ID и ID обязательно должны быть указаны, см. описание arSelectFields выше
$arFilter = Array("IBLOCK_ID"=>7, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y", "FIELD_ARTICLE" => "999999"); //тут?
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
print_r($arFields);
$arProps = $ob->GetProperties();
print_r($arProps);
}
rm: cannot remove 'cache/s2/bitrix/catalog.element': Directory not empty
rm: cannot remove 'cache/s2/bitrix/news.list': Directory not empty
rm: cannot remove 'cache/iblock': Directory not empty
$timestamp = new \Bitrix\Main\Type\Date(date("d.m.Y"));;
$element = new CIBlockElement;
$arLoadProductArray = Array(
"MODIFIED_BY" => 5155,
"TIMESTAMP_X" => $timestamp
);
$element->Update($cyrId, $arLoadProductArray);
const videoMutator = () => {
document.querySelectorAll('figure.media').forEach(element => {
element.outerHTML = '<div>' + element.innerHTML + '</div>';
});
document.querySelectorAll( 'oembed' ).forEach( element => {
let url = element.getAttribute( 'url' );
newUrl = url.split('/');
console.log(newUrl);
if (newUrl[2] == "youtu.be") {
url = "https://www.youtube.com/watch?v=" + newUrl[3];
}
url = url.replace("watch?v=", "embed/");
const newIframe = document.createElement("iframe");
newIframe.setAttribute("width", "640");
newIframe.setAttribute("height", "360");
newIframe.setAttribute("allowFullScreen", "");
newIframe.setAttribute("frameBorder", 0);
if (url) {
newIframe.setAttribute("src", url);
}
element.outerHTML = newIframe.outerHTML;
});
}
setTimeout(videoMutator, 2000);