http://dinbror.dk/blazy/examples/?ref=blog
если у вас нет уже объедененного файла, а есть root, intermediate и crt файл домена, их необходимо склеивать в один bundle.crt с последовательностью: домен -> intermediate -> root
.section.php
$arDirProperties = Array(
"page_top_description" => "Описание раздела"
);
header.php
<?if($page_top_description = $APPLICATION->GetProperty('page_top_description')):?>
<div class="p-top__text"><?=$page_top_description?></div>
<?endif;?>
Переключить все названия на карте mapbox к русскому языку можно по инструкции https://www.mapbox.com/help/change-language/#multiple-layers-at-once
или через плагин
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v10',
center: [-98, 38.88],
minZoom: 2,
zoom: 3
});
mapboxgl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.0/mapbox-gl-rtl-text.js');
map.addControl(new MapboxLanguage({
defaultLanguage: 'ru'
}));
https://github.com/mapbox/mapbox-gl-language/
$(form).find('input[type="text"],input[type="tel"],textarea,input[type="number"],input[type="email"]').val('');
Assets CompressorRefactor-> Compress и получаем нимимифицированный файл
<script>Share = {vkontakte: function(purl, ptitle, pimg, text) {url = 'http://vk.com/share.php?';url += 'url=' + encodeURIComponent(purl);url += '&title=' + encodeURIComponent(ptitle);</div><div> url += '&description=' + encodeURIComponent(text);url += '&image=' + encodeURI(pimg);url += '&noparse=true';Share.popup(url);},odnoklassniki: function(purl, text) {url = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1';url += '&st.comments=' + encodeURIComponent(text);url += '&st._surl=' + encodeURIComponent(purl);Share.popup(url);},facebook: function(purl, ptitle, pimg, text) {url = 'http://www.facebook.com/sharer.php?s=100';url += '&p[title]=' + encodeURIComponent(ptitle);url += '&p[summary]=' + encodeURIComponent(text);url += '&p[url]=' + encodeURIComponent(purl);url += '&p[images][0]=' + encodeURIComponent(pimg);Share.popup(url);},twitter: function(purl, ptitle) {url = 'http://twitter.com/share?';url += 'text=' + encodeURIComponent(ptitle);url += '&url=' + encodeURIComponent(purl);url += '&counturl=' + encodeURIComponent(purl);Share.popup(url);},mailru: function(purl, ptitle, pimg, text) {url = 'http://connect.mail.ru/share?';url += 'url=' + encodeURIComponent(purl);url += '&title=' + encodeURIComponent(ptitle);</div><div> url += '&description=' + encodeURIComponent(text);url += '&imageurl=' + encodeURIComponent(pimg);Share.popup(url)},google: function(purl) {url = 'https://plus.google.com/share?';url += 'url=' + encodeURIComponent(purl);Share.popup(url)},popup: function(url) {window.open(url,'','toolbar=0,status=0,width=626,height=436');}};</script><a onclick="Share.vkontakte('URL','TITLE','IMG_PATH','DESC')"> {шарь меня полностью}</a>
<a onclick="Share.facebook('URL','TITLE','IMG_PATH','DESC')"> {шарь меня полностью}</a>
<a onclick="Share.mailru('URL','TITLE','IMG_PATH','DESC')"> {шарь меня полностью}</a>
<a onclick="Share.odnoklassniki('URL','DESC')"> {шарь меня полностью}</a>
<a onclick="Share.twitter('URL','TITLE')"> {шарь меня полностью}</a>
$length = strlen(utf8_decode($s));
if($arParams['SORT_BY_COMPLEX']){
$sectionsName = $COMPLEX_OBJECT_SECTION_INF = array();
$arFilter = Array('IBLOCK_ID' => OBJECT_MAIN_IBLOCK_ID, 'ACTIVE' => 'Y', 'DEPTH_LEVEL' => 1);//'!UF_SITE_ID'=>false
$db_list = CIBlockSection::GetList(Array('SORT' => 'ASC'), $arFilter, false, array('ID','NAME','UF_SITE_ID','IBLOCK_ID','UF_COMPLEXE_LOGO','CODE'));
while ($ar_result = $db_list->Fetch()) {
$COMPLEX_OBJECT_SECTION_INF[$ar_result['ID']] = $ar_result;
}
foreach ($arResult['ITEMS'] as &$arItem){
$res = CIBlockSection::GetByID($arItem["IBLOCK_SECTION_ID"]);
$arItem['LAST_SECTION_INF'] = $res->Fetch();
$tempArResult[$COMPLEX_OBJECT_SECTION_INF[$arItem['LAST_SECTION_INF']['IBLOCK_SECTION_ID']]['SORT']][] = $arItem;
}
if($arParams['SORT_BY_COMPLEX']=='ASC'){
ksort($tempArResult);
}
else {
krsort($tempArResult);
}
$arResult['ITEMS'] = array();
foreach ($tempArResult as $sort_key=>$group_items){
LOG_INTERFACE::debugToConsole($sort_key,'$sort_key');
foreach ($group_items as $item){
$arResult['ITEMS'][] = $item;
}
}
}
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/svg "access plus 1 week"
ExpiresByType text/svg+xml "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
</IfModule>
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl|svg)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
Redirect 301 /some-shit-section/ http://webkernel.ru/
$pwd = "Your encrypted password here.";$decrypted = '';while (strlen($pwd) > 0) {$decrypted .= chr(hexdec(substr($pwd, 0, 4)) ^ hexdec('dfaa'));$pwd = substr($pwd, 4, strlen($pwd) - 1);}echo $decrypted;
var jq = document.createElement('script'); jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq);
https://dev.1c-bitrix.ru/community/webdev/user/11948/blog/2047/
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {// do something}
if($arParams['BEST_SORT_ARRAY']){
foreach($arParams['BEST_SORT_ARRAY'] as $parent_news_id){
foreach($arResult["ITEMS"] as $key=> $one_item){
if($one_item['ID']==$parent_news_id)
$new_items_arr['ITEMS'][$key] = $one_item;
}
}
$arResult["ITEMS"] = $new_items_arr['ITEMS'];
}
необходимо привести массив к такому виду:
$arrFilter = array(
array(
'LOGIC'=>'OR',
array('ID'=>1749305),
array('ID'=>1994586)
)
);
приводим:
$arrFilter = array(
array(
"LOGIC" => "OR",
),
); $res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nTopCount"=>20), array('PROPERTY_SOME_ID'));
while($ob = $res->Fetch())
{
$arrFilter[0][] = array("ID"=>$ob['PROPERTY_SOME_ID_VALUE']);
}
$(document).bind("mousewheel", stop_scroll);
$(window).bind("scroll mousewheel", stop_scroll);
function stop_scroll(event) {
event.preventDefault();
$(document).scrollTop(top);
} // отключаем запрет $(document).unbind('mousewheel'); $(window).unbind("scroll mousewheel");
$("#phone").val().replace(/\D/g,'')
chown -R bitrix:bitrix /absolute/path/to/site-dir/
AuthType Basic
AuthName "Thats protected Area!"
AuthUserFile /home/bitrix/www/.htpasswd
Require valid-user
<Files .htpasswd>
deny from all
</Files>
<? $this_file_name = pathinfo(__FILE__); require_once($BX_DOC_ROOT.'/bitrix/components/some_space/some_component/templates/.default/lang/'.LANGUAGE_ID.'/'.$this_file_name['basename']); ?>
$.ajax({
type: "POST",
url: $(this).attr("action"),
data: $(this).serialize(),
dataType: 'json'
})
.done(function(data) {
console.log(data);
});
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
preg_match_all('/d="(.*)"/sU',$some_var,$matches, PREG_SET_ORDER);
global $USER; if($USER->IsAdmin()):print_r($arrResult);endif;
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
$('.some-class').on('focus', function(){ OffScroll(); //Запустили отмену прокрутки });
$('.some-class').on('blur', function(){ $(window).unbind('scroll'); //Выключить отмену прокрутки });
function OffScroll () { var winScrollTop = $(window).scrollTop(); $(window).bind('scroll',function () { $(window).scrollTop(winScrollTop); }); }
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<ul>
<li>
<?foreach($arResult["ITEMS"] as $key=>$arItem):?>
<?if(($key+1)%3==0 &&$arItem!=end($arResult["ITEMS"])):?>
</li><li>
<?endif?>
<?endforeach;?>
</li>
</ul>
::-webkit-input-placeholder { color: #646464}
::-moz-placeholder { color: #646464}/* Firefox 19+ */
:-moz-placeholder { color: #646464}/* Firefox 18- */
:-ms-input-placeholder { color: #646464}
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI}
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
$sSectionName = "";
$sPath = $_SERVER["DOCUMENT_ROOT"].$APPLICATION->GetCurDir().".section.php";
<h1><?=$sSectionName?></h1>
$APPLICATION->GetProperty("shown_menu");
$('body,html').animate({scrollTop: 0}, 400);
запись сего в result_modifier.php компонета
$param_sharpen = 30;
$arFilter = array("name" => "sharpen", "precision" => $param_sharpen); // можно просто false
foreach($arResult['ITEMS'] as $item_key=>$item){
$arFile = CFile::GetFileArray($one_pic_id);
$arFileTmp = CFile::ResizeImageGet(
$item['PREVIEW_PICTURE'],
array("width" => 183, "height" => 159),
BX_RESIZE_IMAGE_EXACT,
true, $arFilter
);
$arResult["OUR_WORKS_PICS"][$item_key] = array(
"SRC" => $arFileTmp["src"],
'WIDTH' => $arFileTmp["width"],
'HEIGHT' => $arFileTmp["height"],
);
$arBigFileTmp = CFile::ResizeImageGet(
$item['PREVIEW_PICTURE'],
array("width" => $item['PREVIEW_PICTURE']['WIDTH'], "height" => $item['PREVIEW_PICTURE']['HEIGHT']),
BX_RESIZE_IMAGE_PROPORTIONAL,
true,
$arFilters = Array(array(
"name" => "watermark",
"position" => "center",
"size"=>"real",
'type'=>'image',
'alpha_level'=>30,
"text"=>'sometext',// это поле не выводится (
"file"=>$_SERVER['DOCUMENT_ROOT']."/bitrix/templates/.default/img/logo.png")
)
);
$arResult["OUR_WORKS_BIG_PICS"][$item_key] = array(
"SRC" => $arBigFileTmp["src"]
);
}
$arFilter = Array('IBLOCK_ID'=>$arResult['IBLOCK_ID'], 'GLOBAL_ACTIVE'=>'Y', 'ID'=>$arResult['ID']);
$db_list = CIBlockSection::GetList(Array(), $arFilter, false,array('ID','UF_ADDITIONAL_DESC'));
if($ar_result = $db_list->GetNext())
{
$arResult['UF_ADDITIONAL_DESC'] = $ar_result['~UF_ADDITIONAL_DESC'];
}
RewriteCond %{HTTP_HOST} !^www.webkernel.ru$ [NC]
RewriteRule ^(.*)$ http://www.webkernel.ru/$1 [R=301,L]
требуется создать такой файл: /bitrix/php_interface/user_lang/ru/lang.php с требуемой lang переменной
$MESS["/bitrix/components/bitrix/catalog.section/lang/ru/component.php"]["CATALOG_SECTION_NOT_FOUND"] = "Мой раздел не найден";
-webkit-mask-position: 0 0;
-webkit-mask-size: 100% 100%;
-webkit-mask-image: linear-gradient(90deg, hsla(0, 0%, 0%, 0), hsla(0, 0%, 0%, .2) 50%, hsla(0, 0%, 0%, .8) 80%, hsla(0, 0%, 0%, 1) 100%);
require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/templates/.default/FirePHP.class.php');
$firephp = FirePHP::getInstance(true);
$options = array(
'maxObjectDepth' => 15,
'maxArrayDepth' => 15,
'maxDepth' => 15,
'useNativeJsonEncode' => true,
'includeLineNumbers' => true
);
$firephp->setOptions($options);
@font-face {
font-family: 'robotolight';
src: url('../fonts/roboto-light-webfont.eot');
src: url('../fonts/roboto-light-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/roboto-light-webfont.woff') format('woff'),
url('../fonts/roboto-light-webfont.ttf') format('truetype'),
url('../fonts/roboto-light-webfont.svg#robotolight') format('svg');
font-weight: normal;
font-style: normal;
}
$strEmail = COption::GetOptionString('main','email_from');
$('#top-feedback-form').submit(function(){
if(validator_list.errorList.length==0){
var property = new Object();
property.trigger_name = 'feedback-message';
property.name = $('#top-feedback-form input[name="name"]').val();
property.phone = $('#top-feedback-form input[name="phone"]').val();
var request = $.post(
"/bitrix/templates/.default/ajax-answers/mail-sender.php",
{
"trigger_name" : property.trigger_name,
"name" : property.name,
"phone" : property.phone
},
function(msg){
console.log(msg);
if(msg.error==false){
$.fancybox.open({
height : 50,
autoSize : false,
content : '<div class="server-error-message" >'+msg.error_message+'</div>',
maxWidth : 250,
maxHeight : 10
});
}
else if (msg.error==true){
$.fancybox( '<div class="server-error-message" style="color: red">'+msg.error_message+'</div>' );
}
},
"json"
);
request.fail(function(jqXHR, textStatus) {
alert( "Request failed: " + textStatus );
});
}
return false;
});
preg_replace('/<a(.*)>|<\/a>/sU','',$text)