Skip to content

Instantly share code, notes, and snippets.

View megamosk's full-sized avatar
🎯
Focusing

megamosk

🎯
Focusing
View GitHub Profile
@SeRGei93
SeRGei93 / bitrix remove all orders
Created August 6, 2021 10:40
Битрикс удалить все заказы
<?
if (!isset($_SERVER['DOCUMENT_ROOT']) || !$_SERVER['DOCUMENT_ROOT']) {
$_SERVER['DOCUMENT_ROOT'] = dirname(__DIR__);
}
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
\Bitrix\Main\Loader::includeModule('sale');
use Bitrix\Sale;
@andrei99
andrei99 / Debug;
Last active July 26, 2023 14:30
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/
@FlameInTheDark
FlameInTheDark / include.discount.city.name.php
Last active April 7, 2024 17:14
Добавление кастомных условий для модуля скидок в 1C Bitrix
<?php
/**
* Добавление кастомного условия для скидок.
* Подключить данный файл в init.php
*
* В данном примере устанавливается проверка города сохраненного в сессии
*/
use Bitrix\Main\Loader;
Loader::includeModule('catalog');
@shoman4eg
shoman4eg / footerasset.php
Created March 22, 2017 11:36
Bitrix js in footer
<?php
use Bitrix\Main\Page\Asset;
class FooterAsset
{
const LOCATION = 'FOOTER_LOCATION';
public static function addJs($src, $options = [])
{
@VasiliuKr
VasiliuKr / bitrix_smart_filter_ajax.js
Last active October 26, 2022 07:17
catalog.smart.filter - ajax обновление списка без AXAJ_MODE
// В шаблоне bitrix:catalog.smart.filter редактируем script.js - ищим функцию JCSmartFilter.prototype.postHandler и редактируем следующее
//if (modef.style.display === 'none')
//{
// modef.style.display = 'inline-block';
//}
$.get(
result.FILTER_AJAX_URL,
function (data) {
@frosit
frosit / infectedFiles.md
Created May 5, 2016 22:40
Some commands for finding and clearing infected PHP files

Finding infected files with following bash commands

** Command to list all infected files:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
  • grep -lr --include=*.php "eval" .
  • grep -lr --include=*.php "base64" .

Command to remove malicious code:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'
@s2ar
s2ar / Bitrix. Очистить свойство типа Файл.php
Last active November 20, 2021 18:54
Bitrix. Очистить свойство типа Файл.
<?php
$bx_photo = CIBlockElement::GetProperty(
$IBID,
$id,
'sort',
'asc',
array('CODE' => 'PHOTO')
);
$ar_photo = $bx_photo->Fetch();
@mrverrall
mrverrall / rhel7-moodle.sh
Last active February 1, 2024 15:00
A script that installs and configures all the core components for moodle on RHEL/Centos 7 leaving you with a running site complete with AV scanning and Memcached
#!/bin/bash
#
# This Bash script installs Moodle (http://moodle.org) and all it's
# requirements into a freshly installed Centos or RHEL 7 operating system.
# It assumes an 'Enforced' SELinux environment and configures the system
# accordingly.
#
# It is designed to be instructional and clear to read to persons unfamiliar
# with Bash and as such does *no* sanity checking before taking actions.
# Becasue of this *great* care should be taken if you feel the urge to run
@Itachi261092
Itachi261092 / README.md
Last active January 15, 2024 08:00
[1C-Bitrix / 1С-Битрикс] AJAX Custom Preloader / Кастомный прелоадер стандартного аякса

Кастомный ajax preloader на 1С-Битрикс.

Сам прелоадер честно стырен отсюда, но его можно заменить любым понравившимся кодом.

Ставится легко и просто. В принципе, все файлы понятно названы и проблем не должно возникнуть.

В футер перед /body ставим вызов включаемой области. Скрипт я обычно копирую вниз включаемой области. Весь код в ней - это хтмл код прелоадера.

CSS можно скопировать в template_styles, а можно подключить отдельно в header.php шаблона сайта.

@patric-boehner
patric-boehner / ReadMe.md
Last active October 8, 2020 11:37
Customize WordPress Gallery HTML Output

#Customize WordPress Gallery HTML Output


This snippet is for modifying the shortcode and output for Wordpress's built in gallery function HTML. Particularly to modify the stucture for use with the Salvattore & Featherlight jquery to creat a masonary gallery with lightbox as none of the wordpress plugins meet my need. The source of the function is a little out of date compared with the current function Wordpress is using to output the galleries, but meets my needs as I am stripping out most of the markup. Plus I can't seem to get the shortcode_atts assigned in the function to work but thats not a deal breaker. I've updated the php with my new function. Still not sure if this is the best way to go about this but it works well for my need.

I've also added a second if statment to create another modified gallery to create a homepage slideshow using the wordpress agllery function and add suport for the Responsiveslides Jquery plugin.

I am using a conditional statment to check if the