Options -Indexes
ErrorDocument 404 /404.php
php_value display_errors on
php_value date.timezone Europe/Moscow
<IfModule mod_php5.c>
php_flag session.use_trans_sid off
#php_flag default_charset UTF-8
#php_value display_errors 1
</IfModule>
<IfModule mod_php7.c>
php_flag session.use_trans_sid off
#php_flag default_charset UTF-8
#php_value display_errors 1
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^(.*/[^/\.]+)$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
ExpiresByType image/png "access plus 3 day"
ExpiresByType text/css "access plus 3 day"
ExpiresByType application/javascript "access plus 3 day"
</IfModule>
\Bitrix\Main\Loader::includeModule('iblock');
// Шаг 1: Получаем первые 20 элементов,
$arSelect = Array("ID","NAME","DETAIL_PAGE_URL");
$nPageSize = Array("nPageSize" => 20);
$arSort = Array("SORT" => "ASC");
$arFilter = Array("IBLOCK_ID"=>IntVal($this->arParams['IBLOCK_ID']), "ACTIVE"=>"Y");
$res = CIBlockElement::GetList($arSort, $arFilter, false, $nPageSize, $arSelect);
$ALL_RESULT = [];
$IGNORE_IDS = [];
while($ob = $res->GetNextElement())
{
$GetFields = $ob->GetFields();
$IGNORE_IDS[] = $GetFields["ID"];
$ALL_RESULT[] = $GetFields;
}
// Шаг 2: Получаем 100 случайных элементов убрав из них 20 полученные в Шаге 1,
$nPageSize = Array("nPageSize" => 100);
$arSort = Array("RAND" => "ASC");
$arFilter = Array("!ID" => $IGNORE_IDS, "IBLOCK_ID"=>IntVal($this->arParams['IBLOCK_ID']), "ACTIVE"=>"Y");
$res = CIBlockElement::GetList($arSort, $arFilter, false, $nPageSize, $arSelect);
while($ob = $res->GetNextElement())
{
$GetFields = $ob->GetFields();
$IGNORE_IDS[] = $GetFields["ID"];
$ALL_RESULT[] = $GetFields;
}
// Шаг 3: Получаем оставшиеся элементы убрав из них 120 полученные в результате Шаг 1 и Шаг 2,
$nPageSize = Array();
$arSort = Array("ACTIVE_FROM" => "ASC");
$arFilter = Array("!ID" => $IGNORE_IDS, "IBLOCK_ID"=>IntVal($this->arParams['IBLOCK_ID']), "ACTIVE"=>"Y");
$res = CIBlockElement::GetList($arSort, $arFilter, false, $nPageSize, $arSelect);
while($ob = $res->GetNextElement())
{
$GetFields = $ob->GetFields();
$IGNORE_IDS[] = $GetFields["ID"];
$ALL_RESULT[] = $GetFields;
}
return $ALL_RESULT;
<video src="/upload/video.mp4" class="player_video" preload="metadata" poster="images/poster_video.jpg"></video>
index.php
content/
info.php
about.php
template/
header.php
footer.php
<?php include ('template/header.php'); ?>
<div class="content"> Сюда идет загрузка динамического контента </div>
<?php include ('template/footer.php'); ?>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus a cum recusandae quaerat eaque, iure accusantium? Voluptate cupiditate excepturi obcaecati ipsam reiciendis repudiandae aliquam laborum, quas iure architecto ducimus natus.</p>
<div class="content">
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css"/>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<div class="my-slider">
<div class="item-slide">SLIDE 1</div>
<div class="item-slide">SLIDE 2</div>
<div class="item-slide">SLIDE 2</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('.my-slider').slick({
centerMode: true,
centerPadding: '60px',
slidesToShow: 3,
autoplay: true,
autoplaySpeed: 2000,
});
});
</script>
$(document).ready(function() {
$(".modal_btn").click(function(event) {
event.preventDefault();
var phone = $(".modal_input--phone").val();
var name = $(".modal_input--name").val();
var mail = $(".modal_input--mail").val()
var ms = $(".modal_textarea").val();
var userfile = $(".modal_input--userfile").val();
if (name.length < 1) {
alert('Введите корректное имя')
return false;
} else if (!phone.match(/^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$/)) {
alert('Введите корректный номер телефона')
return false;
} else if (ms.length < 5) {
alert('Сообщение должно содержать от 5-ти символов')
return false;
} else if (!mail.match(/^[-._a-z0-9]+@(?:[a-z0-9][-a-z0-9]+\.)+[a-z]{2,6}$/)) {
alert('Введите корректный e-mail')
return false;
} else {
var fd = new FormData();
fd.append('ms', ms);
fd.append('name', name);
fd.append('phone', phone);
fd.append('mail', mail);
fd.append('userfile', $(".modal_input--userfile")[0].files[0]);
$.ajax({
type: 'POST',
url: './wp-content/themes/uslugi/send_t.php',
data: fd,
processData: false,
contentType: false,
dataType: "json",
success: function(data) {
alert('Заявка успешно отправлена!');
},
error: function(data) {
console.log(data);
}
});
}
});
});