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 convertPHPSizeToBytes($sSize) | |
{ | |
if ( is_numeric( $sSize) ) { | |
return $sSize; | |
} | |
$sSuffix = substr($sSize, -1); | |
$iValue = substr($sSize, 0, -1); | |
switch(strtoupper($sSuffix)){ | |
case 'P': |
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
// Disable scroll zooming and bind back the click event | |
var onMapMouseleaveHandler = function (event) { | |
var that = $(this); | |
that.on('click', onMapClickHandler); | |
that.off('mouseleave', onMapMouseleaveHandler); | |
//that.find('iframe').css("pointer-events", "none"); | |
that.find('#map-wrapper').css("pointer-events", "none"); | |
} |
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
/** | |
* Adding the cluster icon to the dom. | |
* @ignore | |
*/ | |
ClusterIcon.prototype.onAdd = function() { | |
this.div_ = document.createElement('DIV'); | |
if (this.visible_) { | |
var pos = this.getPosFromLatLng_(this.center_); | |
this.div_.style.cssText = this.createCss(pos); |
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://wp-kama.ru/question/php-usort-sortirovka-massiva-po-dvum-polyam | |
* Сортировка массива по двум параметрам с помощью usort() | |
*/ | |
function _usort_object_by_time_ms($a, $b){ | |
// поля по которым сортировать | |
$array = array( 'laps'=>'desc', 'time_ms'=>'asc' ); |
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 | |
AddEventHandler("catalog", "OnPriceUpdate", array("MyClassUpdatePrice", "OnBeforePriceUpdateHandler")); | |
AddEventHandler("catalog", "OnPriceAdd", array("MyClassUpdatePrice", "OnBeforePriceUpdateHandler")); | |
AddEventHandler("iblock", "OnBeforeIBlockElementDelete", Array("MyClassUpdatePrice", "OnBeforeIBlockElementDeleteHandler")); | |
class MyClassUpdatePrice | |
{ | |
function OnBeforePriceUpdateHandler($PRICE_ID, $arFields) { | |
if(!$arFields['PRICE']) $arFields['PRICE'] = 0; | |
if(!$arFields['PRODUCT_ID']) $arFields['PRODUCT_ID'] = $PRICE_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
// method beginner | |
var el = jQuery(this); | |
el.css('pointer-events','none'); | |
// ajax code | |
// method end | |
el.css('pointer-events','auto'); |
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) { //запись значения |
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 | |
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
<?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' => 'Удалить скрипт', |