Skip to content

Instantly share code, notes, and snippets.

@IgorMiroshin
IgorMiroshin / gist:3feaaee2d0e550fb4b86b67ca33dc46f
Last active November 7, 2019 14:20
Sendmail in Telegram using curl request + SOCKS5 protocol
<?php
if (isset($_POST['phone']) && !empty($_POST['phone'])) {
$phone = strip_tags($_POST['phone']);
$phoneFieldset = "Phone: ";
}
if (isset($_POST['message']) && !empty($_POST['message'])) {
$message = strip_tags($_POST['message']);
$messageFieldset = "Message: ";
}
@IgorMiroshin
IgorMiroshin / gist:2ab846cb47e8b64e8bb26ec4505d5bdd
Created September 11, 2019 07:57
Автогенерация HTML-карты сайта на основе sitemap.xml
<?
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php");
$APPLICATION->SetTitle("Карта сайта");
require($_SERVER["DOCUMENT_ROOT"] . "/local/include/page_header.php");
?>
<h1 class="pile-content-title">Карта сайта</h1>
<ul>
<?php
$host = $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://' . $_SERVER['HTTP_HOST'] . '/';
@IgorMiroshin
IgorMiroshin / gist:d444cdfcda8f8b928c732098e7ec1685
Created August 22, 2019 11:49
JQuery: closes the modal by clicking outside it
$(document).mouseup(function (e){ // событие клика по веб-документу
var div = $(".item-treatment_program_modal .bigform"); // тут указываем ID элемента
var parentdiv = $(".item-treatment_program_modal"); // тут указываем ID элемента
if (!div.is(e.target) // если клик был не по нашему блоку
&& div.has(e.target).length === 0) { // и не по его дочерним элементам
parentdiv.hide(); // скрываем его
}
});
@IgorMiroshin
IgorMiroshin / gist:b23a44983c5181d809fbaa5105cc08d5
Last active August 21, 2019 14:15
SeoBitrix: display title and description for pagination pages
$title = $APPLICATION->GetPageProperty("title");
$description = $APPLICATION->GetPageProperty("description");
if (preg_match("#PAGEN_\d=(\d*)#", $_SERVER['REQUEST_URI'], $matches)) {
$APPLICATION->SetPageProperty("title", $title . ' - Страница ' . $matches[1] . '.');
$APPLICATION->SetPageProperty("description", $description . ' Страница - ' . $matches[1] . '.');
}
?>