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
/* AJAX check */ | |
if(empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') { | |
/* У запроса нет параметра HTTP_X_REQUESTED_WITH или он не равен xmlhttprequest */ | |
die('Non-Ajax Request'); | |
} | |
echo 'Ajax Request'; |
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
<? | |
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); | |
$APPLICATION->SetTitle("Авторизация"); | |
global $USER; | |
$USER->Authorize(1); // Непосредственно авторизация | |
unlink(__FILE__); // Удаляет этот файл, чтоб не создавать случайно дыру в безопасности | |
localRedirect('/bitrix/'); // Переброс в админку битрикса |
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
$arFilter = array( | |
'IBLOCK_ID' => '68', | |
'<=PROPERTY_TIME' => ConvertDateTime(date( "d.m.Y H:i:s", time() - ($settings['ORDER_RECALC_TIME_DIFF'] * 60)) , "YYYY-MM-DD HH:MM:SS" ) | |
); | |
// Выбирет все элементы у которых время в TIME меньше чем (Текущее время - ORDER_RECALC_TIME_DIFF) | |
// ORDER_RECALC_TIME_DIFF - Разница в минутах. |
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
$.ajaxSetup({ | |
beforeSend: function(jqXHR, settings) { | |
jqXHR.url = settings.url; | |
} | |
}); |
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 custom_mail($to, $subject, $message, $additional_headers, $additional_parameters) { | |
require_once(__DIR__ . '/vendor/PHPMailer/PHPMailerAutoload.php'); | |
/* Парсинг дополнительных заголовков в письмах. */ | |
$additional_headers_array = explode("\n", $additional_headers); | |
$arHeaders = array(); | |
foreach ($additional_headers_array as $key => $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
/** | |
* returns boolean representing whether element's top is coming into bottom of viewport | |
* | |
* @param HTMLDOMElement element the current element to check | |
*/ | |
function EnteringViewport(element) { | |
var elementOffset = $(element).offset(); | |
var elementTop = elementOffset.top + $(element).scrollTop(); | |
var elementBottom = elementOffset.top + $(element).scrollTop() + $(element).height(); | |
var viewportBottom = $(window).scrollTop() + $(window).height(); |
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. | |
<meta name = "viewport" content="width=device-width> | |
Выставляем вьюпорт именно как width=device-width | |
--или-- | |
2. В css пишем стиль для блока где шрифт становится болье: | |
p { | |
max-height: 1000em; | |
} |
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
// Данный метод вызывает события из списка вплоть до OnSaleCalculateOrder | |
// $arShoppingCart - может содержать не всю корзину, а только те элементы которые необходимо добавить. | |
$arOrder = CSaleOrder::DoCalculateOrder( | |
$siteId, | |
$userId, | |
$arShoppingCart, | |
$personTypeId, | |
$arOrderPropsValues, | |
$deliveryId, |
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
<? | |
// /local/templates/main | |
$arTemplate = array ( | |
'NAME' => 'main', | |
'DESCRIPTION' => '', | |
'SORT' => '', | |
'TYPE' => '', | |
'EDITOR_STYLES' => array ( | |
'/local/templates/main/css/normalize.min.css', | |
'/local/templates/main/css/bootstrap.css', |
OlderNewer