Skip to content

Instantly share code, notes, and snippets.

View helloris25's full-sized avatar
😎

helloris25

😎
View GitHub Profile
@helloris25
helloris25 / simple_create_section.php
Last active February 4, 2018 17:18
Быстрое создание секций битриксе
<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetPageProperty("NOT_SHOW_NAV_CHAIN", "Y");
$APPLICATION->SetTitle("Импорт секций инфоблока");
if(CModule::IncludeModule("iblock")) {
$arIBlocks = [];
$rsIBlocks = CIBlock::GetList(["sort" => "asc"], ["ACTIVE" => "Y"]);
while($arIBlock = $rsIBlocks->Fetch())
{
@helloris25
helloris25 / Быстрый импорт элементов инфоблока из xml-файла с настройками по умолчанию:
Last active August 29, 2015 14:09
Быстрый импорт элементов инфоблока из xml-файла с настройками по умолчанию:
<?php
$ABS_FILE_NAME = $_SERVER["DOCUMENT_ROOT"]."/xml/demo.xml";
$WORK_DIR_NAME = substr($ABS_FILE_NAME, 0, strrpos($ABS_FILE_NAME, "/")+1);
$obXMLFile = new CIBlockXMLFile;
// Удаляем результат предыдущей загрузки
$obXMLFile->DropTemporaryTables();
// Подготавливаем БД
if($obXMLFile->CreateTemporaryTables())
{
@helloris25
helloris25 / import_section
Created September 24, 2014 06:52
Импорт категорий в битрик
<?php
/**
* ПОЛУЧАЕМ ВСЕ ПОДКАТЕГОРИИ OASIS
*/
// ID корневой секции
$root_id = 82663;
$rsParentSection = CIBlockSection::GetByID($root_id);
if ($arParentSection = $rsParentSection->GetNext())