Skip to content

Instantly share code, notes, and snippets.

@andrei99
andrei99 / openserver
Last active July 18, 2024 07:25
openserver
//cron
%progdir%\modules\php%phpdriver%\php-win.exe -c %progdir%\modules\php%phpdriver%\php.ini -q -f %sitedir%\delight\bitrix\modules\main\tools\cron_events.php
delight - path
@andrei99
andrei99 / host
Last active May 14, 2021 09:11
KEENETIC
router/a
#rest get
ip host
ip host {domain} {address}
system configuration save
"domain": "local.name-site.ru",
"address": "192.168.1.112"
@andrei99
andrei99 / Link
Last active December 15, 2023 09:01
Links
@andrei99
andrei99 / Install
Last active August 8, 2020 19:19
Vue
download node js
npm install -g @vue/cli
--new
vue create name-project
vue create -n name-project //not git
vue create . //this folder
--run
@andrei99
andrei99 / redirect seo
Last active March 31, 2021 15:52
.htaccess
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
#redirect http->https, www->empty, index.php->empty
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ https://hotel-shanell.ru/ [R=301,L]
RewriteRule ^(.*)=(.*) /$1$2 [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
@andrei99
andrei99 / Debug;
Last active August 16, 2024 09:06
d7 bitrix
\Bitrix\Main\Diag\Debug::writeToFile($signatureValue, '$signatureValue', '__#params_1.log');
//php 8.1
https://www.sng-it.ru/snippet/oshibki-pri-perekhode-sayta-na-bitrikse-na-php-8-1.html
//платежка
https://g-rain-design.ru/blog/posts/payment-handlers-bitrix-d7/
//скорость выполнения скрипта
$time_start = microtime(true);
<?
require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');
require_once($_SERVER['DOCUMENT_ROOT'] . "/bitrix/php_interface/libs/tcpdf/tcpdf.php");
use Bitrix\Main\Application;
use Bitrix\Main\Context;
$obRequest = Application::getInstance()->getContext()->getRequest();
$intID = $obRequest->get('id');
####### GOOGLE console
https://search.google.com/test/rich-results?utm_campaign=devsite&utm_medium=jsonld&utm_source=article&id=biHfArES8wbgNoMSc0OMFw
$arSchemaOrg = array(
'@context' => 'http://schema.org',
'@type' => 'Article',
'name' => $arResult['NAME'],
'datePublished' => $strDateActive,
'author' => 'person',
<?php
use Bitrix\Main\Loader;
use Bitrix\Main\Diag\Debug;
Loader::includeModule('iblock');
Loader::includeModule('catalog');
AddEventHandler('iblock', 'OnAfterIBlockElementAdd', 'setProductMinPrice');
AddEventHandler('iblock', 'OnAfterIBlockElementUpdate', 'setProductMinPrice');
@andrei99
andrei99 / Send file email bitrix
Last active July 8, 2021 08:04
Sender Bitrix
//html
<form enctype="multipart/form-data" method="post">
<input type="file" name="place_file[]" multiple>
</fotm>
//php
$obContext = Context::getCurrent();
$obRequest = $obContext->getRequest();
$arFileAll = array();