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
new Fancybox([{ | |
src: '#cancel_popup' | |
}], { | |
dragToClose: false, | |
closeButton: true, | |
on: { | |
close: () => {} | |
} | |
}) |
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
// растягиваем img | |
{ | |
object-fit: cover; | |
-o-object-fit: cover; | |
} | |
// Фикс элементов submit в мобильном safari | |
[type="submit"] { | |
-webkit-appearance: 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
// дебажим через логи в файл | |
$file = $_SERVER["DOCUMENT_ROOT"] .'/log.txt'; | |
file_put_contents($file, $url . PHP_EOL, FILE_APPEND); | |
file_put_contents($file, $result . PHP_EOL, FILE_APPEND); | |
// склонение числительных | |
function num_word($value, $words, $show = true) | |
{ | |
$num = $value % 100; | |
if ($num > 19) { |
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
// пагинация | |
get_the_posts_pagination(); | |
// канониклы при пагинации | |
add_filter('wpseo_canonical', 'removeCanonicalArchivePagination'); | |
function removeCanonicalArchivePagination($link) { | |
$link = preg_replace('#\\??/page[\\/=]\\d+#', '', $link); | |
return $link; | |
} |
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
// envybox | |
https://envybox.io/help/knowledge-base/jsapi-vidzhetov-opisanie-metodov/ | |
// микроразметка | |
<? | |
$og='<!-- OpenGraph -->'."\n"; | |
$og.='<meta property="og:title" content="'.$arResult["NAME"].'" />'."\n"; | |
$og.='<meta property="og:url" content="https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . '" />'."\n"; | |
$og.='<meta property="og:image" content="https://' . $_SERVER['SERVER_NAME'] . $arResult["DETAIL_PICTURE"]["SRC"] . '" />'."\n"; |
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
RewriteEngine on | |
# Директива включает редиректы. | |
ErrorDocument 404 /404.html | |
# 404 ведет на 404.html | |
############################################################################ | |
#### Редирект на нижний регистр (если поддерживается tolower) #### | |
############################################################################ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond expr "tolower(%{REQUEST_URI}) =~ /(.*)/" |
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
// генерация пароля | |
\Bitrix\Main\Security\Random::getString(12, true) | |
// отложенные функции | |
https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=43&LESSON_ID=3489 | |
// из той же оперы | |
https://dev.1c-bitrix.ru/api_help/main/reference/cmain/showviewcontent.php | |
// проверка не пустая ли выборка |