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"); | |
$APPLICATION->SetPageProperty("NOT_SHOW_NAV_CHAIN", "Y"); | |
$APPLICATION->SetTitle("Импорт секций инфоблока"); | |
if(CModule::IncludeModule("iblock")) { | |
$arIBlocks = []; | |
$rsIBlocks = CIBlock::GetList(["sort" => "asc"], ["ACTIVE" => "Y"]); | |
while($arIBlock = $rsIBlocks->Fetch()) | |
{ |
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
add_action('customize_register', 'dco_customize_register'); | |
function dco_customize_register($wp_customize) { | |
//FOOTER | |
$wp_customize->add_section('footer', array( | |
'title' => 'Подвал', | |
'priority' => 1, | |
)); | |
//footer text |
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
/** | |
* HEX Color sanitization callback. | |
* | |
* - Sanitization: hex_color | |
* - Control: text, WP_Customize_Color_Control | |
* | |
* Note: sanitize_hex_color_no_hash() can also be used here, depending on whether | |
* or not the hash prefix should be stored/retrieved with the hex color value. | |
* | |
* @see sanitize_hex_color() https://developer.wordpress.org/reference/functions/sanitize_hex_color/ |
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
<? | |
$res = CIBlockSection::GetList( | |
Array('name' => 'asc'), | |
Array('IBLOCK_ID' =>'5' , 'ACTIVE' => 'Y') | |
); | |
while ($row = $res->GetNext()) | |
{ | |
echo $row['NAME'].'<br>'; | |
$rsParentSection = CIBlockSection::GetByID($row['ID']); | |
if ($arParentSection = $rsParentSection->GetNext()) |
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
$('form[name="faq-ui-dialog"] input[type="submit"]').click(function(){ | |
var Error = false, | |
ErrorList = ''; | |
Captcha = $('form[name="faq-ui-dialog"] input[name="captcha_word"]').val(); | |
if($('form[name="faq-ui-dialog"] input[name="PHONE"]').val() == '' ){ | |
Error=true; | |
ErrorList+='Вы не ввели телефон или ввели его не верно!<br/>'; | |
} |
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() { | |
var script, | |
scripts = document.getElementsByTagName('script')[0]; | |
function load(url) { | |
script = document.createElement('script'); | |
script.async = true; | |
script.src = url; | |
scripts.parentNode.insertBefore(script, scripts); |
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
<? | |
define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"]."/log.txt"); | |
//define('siteType', 'dev'); | |
//Определяем мобильные устройства библиотекой http://mobiledetect.net/ | |
require_once 'include/Mobile_Detect.php'; | |
$detect = new Mobile_Detect; | |
//Все мобилные устройства кроме планшетов | |
if( $detect->isMobile() && !$detect->isTablet() ){ |
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
$('.order').click(function(){ | |
var ide = $(this).parent().find('input:hidden').val(); | |
$.ajax({ | |
type: "POST", | |
data: 'action=ADD2BASKET&ajax_basket=Y&id='+ide, | |
url: '/', | |
success: function(data){ | |
data = data.split('\'').join('\u0022'); | |
var obj = JSON && JSON.parse(data) || $.parseJSON(data); | |
if (obj.STATUS == 'OK'){ |
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 (!empty($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"])):?> | |
<?foreach($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] as $photo):?> | |
<img src="<?=CFile::GetPath($photo)?>" /> | |
<?endforeach?> | |
<?endif?> | |
//Пояснения: MORE_PHOTO — это код нашего свойства информационного блока в Битрикс. GetPath это метод класса CFile, который просто возвращает путь к нашему изображению — зарегистрированному файлу. И выводить элементы лучше из массива $arResult[«DISPLAY_PROPERTIES»] — давайте уважать редакторов контента =) | |
//Если нам нужно сразу отмасштабировать изображение… |
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
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin | |
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril | |
animation: "fade", //String: Select your animation type, "fade" or "slide" | |
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported! | |
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" | |
reverse: false, //{NEW} Boolean: Reverse the animation direction | |
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end | |
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode | |
startAt: 0, //Integer: The slide that the slider should start on. Array nota |
OlderNewer