Hello! Dear community, help in the implementation of the task. It is necessary to implement the automatic filling of the news information block. I smoked manuals and APIs, of course I did not find a ready solution, I tried to make my own piece of code, and of course nichrome doesn’t work, maybe there are people who have encountered such a task.
$nameNews = "Тест"; $dateNews = 20.01.2012; $contentNews = "Полное описание" $new_el = new CIBlockElement; $arLoadArray = Array( "MODIFIED_BY" => $USER->GetID(), // элемент изменен текущим пользователем "IBLOCK_SECTION_ID" => false, // элемент лежит в корне раздела "IBLOCK_ID" => 95, // ID инфоблока "NAME" => $nameNews, "ACTIVE" => "Y", // активен "DATE_ACTIVE_FROM" => $dateNews, //начало активности "PREVIEW_TEXT" => $nameNews, "PREVIEW_TEXT_TYPE" => 'html', "DETAIL_TEXT" => $contentNews, "DETAIL_TEXT_TYPE" => 'html' ); if($PRODUCT_ID = $new_el->Add($arLoadProductArray)) echo "New ID: ".$PRODUCT_ID; else echo "Error: ".$new_el->LAST_ERROR;
When accessing the file HTTP Error 500 (Internal Server Error): An unexpected situation occurred when the server attempted to execute the request.