Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CModule::IncludeModule("iblock");
$PROP[ID_Свойства] = $_REQUEST[el_id];
$el = new CIBlockElement;
$arFields = Array(
"DATE_CREATE" => date("d.m.Y H:i:s"), //Передаем дата создания
"CREATED_BY" => 1, //Передаем ID пользователя кто добавляет
"IBLOCK_SECTION_ID" => false, //ID раздела ели есть
"IBLOCK_ID" => 9, //ID информационного блока
"NAME" => $_REQUEST[el_id].$_REQUEST[user_name],
"ACTIVE" => "N", //поумолчанию делаем активным или ставим N для отключении поумолчанию
"PREVIEW_TEXT" => $_REQUEST[user_review],
"PROPERTY_VALUES" => $PROP,
);
if ($ID = $el->Add($arFields)) {
$result['status'] = 'success';
echo "Элемент добавлен";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.