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 | |
//function defination to convert array to xml | |
function array_to_xml($array, &$xml_user_info) { | |
foreach($array as $key => $value) { | |
if(is_array($value)) { | |
if(!is_numeric($key)){ | |
$subnode = $xml_user_info->addChild("$key"); | |
array_to_xml($value, $subnode); | |
}else{ | |
$subnode = $xml_user_info->addChild("item$key"); |
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 | |
// Взято с http://thisis-blog.ru/elementi-highload-bloka/#compl | |
// подключаем пространство имен класса HighloadBlockTable и даём ему псевдоним HLBT для удобной работы | |
use Bitrix\Highloadblock\HighloadBlockTable as HLBT; | |
//подключаем модуль highloadblock | |
CModule::IncludeModule('highloadblock'); | |
//Напишем функцию получения экземпляра класса: |
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 | |
// Получить свойство элемента | |
$rProp = CIBlockElement::GetProperty($iblock_id, $element_id, "sort", "asc", array("CODE" => "badge")); | |
$badge = ($aProp = $rProp->GetNext())? $aProp['VALUE'] :''; |
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 | |
$bx_photo = CIBlockElement::GetProperty( | |
$IBID, | |
$id, | |
'sort', | |
'asc', | |
array('CODE' => 'PHOTO') | |
); | |
$ar_photo = $bx_photo->Fetch(); |
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 | |
$_FILES['appl_file_input']["MODULE_ID"] = "docsapplications"; | |
CIBlockElement::SetPropertyValueCode($id, 'APDOCS_FILE', $_FILES['appl_file_input']); |
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 | |
// Оригинал http://pai-bx.com/wiki/1c-bitrix/2913-perform-actions-only-when-a-confirm-password/ | |
$arUser["PASSWORD"] = $USER->GetParam("PASSWORD_HASH"); | |
$arParams["PASSWORD"] = $_POST['PASSWORD']; | |
$arParams["NEW_PASSWORD"] = $_POST['NEW_PASSWORD']; | |
$arParams["NEW_PASSWORD_CONFIRM"] = $_POST['CONFIRM_NEW_PASSWORD']; | |
if (strlen($arUser["PASSWORD"]) > 32) { | |
$salt = substr($arUser["PASSWORD"], 0, strlen($arUser["PASSWORD"]) - 32); |
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
<?define("NOT_CHECK_PERMISSIONS", true);?> | |
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");?> | |
<? | |
if(defined('BX_UTF') && BX_UTF == TRUE){ | |
$msg = array( | |
'charset' => 'UTF-8', | |
'userChngScs' => 'Пользователь успешно изменён.', | |
'userAddScs' => 'Пользователь успешно добавлен.', | |
'delScript' => 'Удалить скрипт', |
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 | |
if(!function_exists('cmp')){ | |
function cmp($a, $b) { | |
return strcasecmp($a['short_name'], $b['short_name']); | |
} | |
} | |
uasort($arResult['OFFER_LEAF'], 'cmp'); |
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 | |
if($data1=='y') // Год | |
$arFilter['>UF_DATE_LAST_APPL']=date($DB->DateFormatToPHP(FORMAT_DATETIME), time()-31536000); | |
if($data1=='m') // Месяц | |
$arFilter['>UF_DATE_LAST_APPL']=date($DB->DateFormatToPHP(FORMAT_DATETIME), time()-2678400); | |
if($data1=='w') // Неделя | |
$arFilter['>UF_DATE_LAST_APPL']=date($DB->DateFormatToPHP(FORMAT_DATETIME), time()-604800); |
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 | |
/** | |
* Пример использования | |
* SetUserField ("BLOG_RATING", $CommentID, "UF_RATING", $Rating); | |
* echo "Рейтинг комментария: ".GetUserField ("BLOG_RATING", $CommentID, "UF_RATING"); | |
*/ | |
function SetUserField($entity_id, $value_id, $uf_id, $uf_value) { //запись значения |