Skip to content

Instantly share code, notes, and snippets.

@EscApp2
EscApp2 / init.php
Last active November 20, 2024 12:08
bitrix Add special seo parameter OnTemplateGetFunctionClass
<?
//https://g-rain-design.ru/components/seofunc/help/
//https://dev.1c-bitrix.ru/community/webdev/user/87386/blog/9317/
//Подключаем модуль инфоблоков
if (\Bitrix\Main\Loader::includeModule('iblock'))
{
//регистрируем обработчик события
@EscApp2
EscApp2 / console.php
Created November 15, 2016 18:28
/proc/pid/stat
<?
//https://www.redhat.com/archives/axp-list/2001-January/msg00355.html
//http://brokestream.com/procstat.html
//https://github.com/hackman/linux-sysadmin-course/blob/master/additional/lecture-03/proc-pid-status-explained.txt
$pid = getmypid();
exec('cat /proc/'.$pid.'/stat', $stat);
$a = explode(" ",$stat[0]);
@EscApp2
EscApp2 / init.php
Last active November 29, 2023 10:59
GetClassMethods get metods methods getmetods getmethods
<?
function GetClassMethods($object){
$arReturn = array();
$class = new \ReflectionClass($object);
foreach($class->getMethods() as $method){
if($method->isPublic()){
@EscApp2
EscApp2 / txt.txt
Created December 7, 2016 11:43
check image for corrupt, проверка изображения jpg jpeg gif на валидность,
http://nl1.php.net/manual/en/function.imagecreatefromstring.php
@EscApp2
EscApp2 / txt.txt
Created December 8, 2016 13:01
Установка прав на доступ в админку bitrix битрикс авторизация нет доступа
1)Нужно дать группе доступ (право чтения) на папку /bitrix/admin/
2)При изменении прав доступа в группе нужно перепривязать всех пользователей. Они сами отвязываются !!!!!! Берут и сами отвязываются !"№;%:?*()
@EscApp2
EscApp2 / txt.txt
Created December 8, 2016 17:31
bitrix файл не найден картинка для анонса детальная картинка detail picture preview picture
Проверить доступы к папке /upload/ и подпапкам
@EscApp2
EscApp2 / init.php
Created December 20, 2016 18:46
validate filename dir name file name dirname
<?php
//http://stackoverflow.com/questions/6222215/regex-for-validating-folder-name-file-name
function validateFileName($file_name){
return str_replace("\\/?%*:|\"<>","_",$file_name);
}
@EscApp2
EscApp2 / 1txt.txt
Last active January 8, 2024 12:52
bitrix 18.5 16.5 16.0 sale.order.ajax объединить свойства и регион в свойствах / bitrix 18.0 sale.order.ajax перенести свойства в деливери
file order_ajax.js
1)
editActiveRegionBlock: function(activeNodeMode)
{
//добавить этот код в начало фукцнии editActiveRegionBlock
var node = activeNodeMode ? this.regionBlockNode : this.regionHiddenBlockNode,
regionContent, regionNode, regionNodeCol;
regionContent = node.querySelector('.bx-soa-section-content');
@EscApp2
EscApp2 / ajax.php
Last active June 24, 2024 14:09
Custom component ajax bitirx sale.basket.basket
<?
define("NO_KEEP_STATISTIC", true); // Не собираем стату по действиям AJAX
define('NO_AGENT_CHECK', true);
define("NOT_CHECK_PERMISSIONS", true);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
$action = (string)$_REQUEST['ajax_action'];
if($action == "component"){
@EscApp2
EscApp2 / cron_events.php
Created January 19, 2017 14:00
cron agents file bitrix
<?php
$_SERVER["DOCUMENT_ROOT"] = realpath(dirname(__FILE__)."/../../");
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];
define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS",true);
define('CHK_EVENT', true);
define('BX_NO_ACCELERATOR_RESET', true);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");