This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Если исключаем папку например ajax обязательно указать | |
/ajax | |
чтобы брало от корня. | |
Если указать просто ajax - исключит изо всех подпапок по всему сайту этоу папку. | |
2. Исключить папку bitrix, но оставить подпапку aspro_max внутри. | |
/bitrix/* | |
!/bitrix/templates/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* установить значение свойства одного множественного элемента инфоблока | |
* @param [type] $ELEMENT_ID [ID элемента инфоблока] | |
* @param [type] $PROPERTY_CODE [свойства] | |
* @param [type] $PROPERTY_VALUE_ID [ID значения] | |
*/ | |
function setOneElementPropertyValue($ELEMENT_ID, $PROPERTY_CODE, $PROPERTY_VALUE_ID) | |
{ | |
$arrValues = getArrayOfPropertyValues($ELEMENT_ID, $PROPERTY_CODE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Получить массив значаний свойства элемента инфоблока | |
*/ | |
function getArrayOfPropertyValues($ELEMENT_ID, $PROPERTY_CODE) | |
{ | |
$arrValues = []; | |
//Получаем значение свойств инфоблока | |
$db_props = CIBlockElement::GetProperty( | |
MAIN_CATALOG_IB_ID, | |
$ELEMENT_ID, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$letter = []; | |
$sQuery = ''; | |
$sQuery .= 'SELECT DISTINCT '; | |
$sQuery .= 'UPPER(LEFT(LTRIM(NAME), 1)) AS LETTER '; | |
//$sQuery .= 'UPPER(NAME) AS LETTER '; | |
$sQuery .= 'FROM b_iblock_element BE '; | |
$sQuery .= 'WHERE BE.IBLOCK_ID = '.CONTENT_BREND_IB_ID.' AND BE.ACTIVE = "Y" AND BE.WF_STATUS_ID = 1 AND BE.WF_PARENT_ELEMENT_ID IS NULL'; | |
$sQuery .= ' ORDER BY LETTER ASC '; | |
$rsItems = $GLOBALS['DB']->Query($sQuery, false, __LINE__); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Имеется ID элемента. В инфоблоке несколько уровней вложенности. Как получить ID корневой папки этого элемента? | |
select | |
s.* | |
from b_iblock_section_element l | |
join b_iblock_section s | |
on s.ID = l.IBLOCK_SECTION_ID | |
where | |
l.IBLOCK_ELEMENT_ID = $id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
компонент bitrix:catalog.section | |
1. Включить опцию: | |
"SHOW_ALL_WO_SECTION" => "Y", | |
2. Заполнить опции для ID блоков: | |
"IBLOCK_ID" => "49", | |
"IBLOCK_TYPE" => "1c_catalog", | |
3. Обязательно сделать пустым секцию | |
"SECTION_CODE" => "", | |
"SECTION_ID" => "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
global $DB; | |
$orig_sql_stat = $DB->ShowSqlStat; | |
$DB->ShowSqlStat=true; | |
$res_elem = CIBlockElement::GetList( | |
array(), | |
$arFilter, | |
false, | |
false, //array('nTopCount'=>1), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new class Tabs { | |
constructor() { | |
this.$wrapper; | |
this.$triggers; | |
this.$body; | |
this.init(); | |
} | |
init() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* ################################ | |
* ## Page ## | |
* ################################ | |
*/ | |
$isAdminSection = function() { | |
$requestedDir = \Bitrix\Main\Context::getCurrent()->getRequest()->getRequestedPageDirectory(); | |
return (substr($requestedDir, 0, strlen("/bitrix/admin/")) == "/bitrix/admin/" | |
|| substr($requestedDir, 0, strlen("/bitrix/updates/")) == "/bitrix/updates/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Class readTimeEstimate | |
* Подсчет времени чтения статьи | |
*/ | |
class readTimeEstimate | |
{ | |
/** | |
* Средняя скорость чтения слов в минуту | |
*/ | |
const WORDS_PER_MINUTE = 200; |
OlderNewer