This file contains hidden or 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 mobro() | |
{ | |
$useragent = $_SERVER['HTTP_USER_AGENT']; | |
if (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino |android|ipad|playbook|silk/i', $useragent) || preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|i |
This file contains hidden or 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
$APPLICATION->SetAdditionalCSS("https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.1/jquery.fancybox.css"); | |
$APPLICATION->AddHeadScript('https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.1/jquery.fancybox.js'); |
This file contains hidden or 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
<? | |
CJSCore::Init(array('currency')); | |
$currencyFormat = CCurrencyLang::GetFormatDescription('RUB'); | |
?> | |
<script type="text/javascript"> | |
BX.Currency.setCurrencyFormat('RUB', <? echo CUtil::PhpToJSObject($currencyFormat, false, true); ?>); | |
var formatRub = BX.Currency.currencyFormat(121.50, 'RUB', true); | |
alert(formatRub); | |
</script> |
This file contains hidden or 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
var identifier; | |
identifier = $("[data-onevalue=" + this.offers[index].TREE.PROP_35 + "]"); | |
identifier = identifier[0].innerText; | |
var regexp = /[0-9]{2,}/g; | |
regexp.lastIndex = 1; | |
var myRe = identifier.match(regexp); |
This file contains hidden or 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 | |
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php"); | |
$filepath = $_SERVER['DOCUMENT_ROOT'] . "/upload/price.xlsx"; //файл для считывания | |
$beginIndex = 12; //первая строка, с которой нужно начать считывание | |
define("IBLOCK_CATALOG_ID", 4); //ID инфоблока с каталогом | |
define("SUPPLIER_CODE", "OLDIMGROUP"); //код свойства с поставщиком | |
if (!file_exists($filepath)) { | |
print "No input file specified.\n"; |
This file contains hidden or 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
$map_data['yandex_lat'] = $latitude; //значение типа 56.827911201256 | |
$map_data['yandex_lon'] = $longitude; //значение типа 56.827911201256 | |
$map_data['yandex_scale'] = 14; | |
$map_data['PLACEMARKS'][0] = array( | |
"LON" => $longitude, | |
"LAT" => $latitude, | |
"TEXT" => $address //любая текстовая строка | |
); | |
$APPLICATION->IncludeComponent( |
This file contains hidden or 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
$MESS["CT_BCSL_ELEMENT_DELETE_CONFIRM"] = "Будет удалена вся информация, связанная с этой записью. Продолжить?"; | |
$strSectionEdit = CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "SECTION_EDIT"); | |
$strSectionDelete = CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "SECTION_DELETE"); | |
$arSectionDeleteParams = array("CONFIRM" => GetMessage('CT_BCSL_ELEMENT_DELETE_CONFIRM')); | |
$this->AddEditAction($arSection['ID'], $arSection['EDIT_LINK'], $strSectionEdit); | |
$this->AddDeleteAction($arSection['ID'], $arSection['DELETE_LINK'], $strSectionDelete, $arSectionDeleteParams); | |
$this->AddEditAction($arItem['ID'], $arItem['EDIT_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_EDIT")); |
This file contains hidden or 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 pluralForm($n, $resultat, $resultata, $resultatov) | |
{ | |
$n = abs($n) % 100; | |
$n1 = $n % 10; | |
if ($n > 10 && $n < 20) return $resultatov; | |
if ($n1 > 1 && $n1 < 5) return $resultata; | |
if ($n1 == 1) return $resultat; | |
return $resultatov; | |
} |
This file contains hidden or 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
$link = parse_url($youTubeRef, PHP_URL_QUERY); | |
$link = substr($link, 2); | |
$key = "AIzaSyC_pztO0mmCmOwe2FaJjF5vZuM80UGLCO8"; | |
$buf = file_get_contents("https://www.googleapis.com/youtube/v3/videos?part=snippet&id=".$link."&key=".$key); | |
$json = json_decode($buf, 1); | |
$title = $json['items'][0]['snippet']['title']; |
This file contains hidden or 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
if (CModule::IncludeModule("iblock")) | |
{ | |
$arFilter = array( | |
"ACTIVE" => "Y", | |
"GLOBAL_ACTIVE" => "Y", | |
"IBLOCK_ID" => $arParams["IBLOCK_ID"], | |
); | |
if(strlen($arResult["VARIABLES"]["SECTION_CODE"])>0) | |
{ | |
$arFilter["CODE"] = $arResult["VARIABLES"]["SECTION_CODE"]; |