Skip to content

Instantly share code, notes, and snippets.

View alexstep's full-sized avatar

kellas alexstep

View GitHub Profile
@alexstep
alexstep / bx_page_tpl.php
Created October 19, 2012 13:59
bitrix page template
<?php
/*
* Опиши тут, что это за файл!
*
*/
// define('SITE_TEMPLATE_ID','main');
require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php');
// CModule::IncludeModule("iblock");
// CModule::IncludeModule("forum");
@alexstep
alexstep / fopen-fputs.php
Created October 4, 2012 10:30
php wrtite file
// http://www.php.su/functions/?fopen
$filecontent = 'some content';
$file = fopen($_SERVER["DOCUMENT_ROOT"]."/path/name.txt","w+");
fputs($file, $filecontent);
fclose($file);
@alexstep
alexstep / bx_secs_tree.php
Created October 4, 2012 10:27
bitrix: sections tree
/* Получаем и кешируем информацию о разделах(sections) */
// должен быть подключен CModule::IncludeModule("iblock");
!!!!!!! $_sections_iblock_id = .укажи id инфоблока
$obCache = new CPHPCache;
if($obCache->InitCache(24*60, 'list_sections', '/cache_path/' ){
$vars = $obCache->GetVars();
$sections = $vars["sections"];
$sections_by_code = $vars["sections_by_code"];
} else if($obCache->StartDataCache()) {