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
//*замена адрема после переноса | |
UPDATE wp_options SET option_value = REPLACE(option_value, 'http://ilyarrl2.beget.tech', 'http://re-wp.by') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = REPLACE(guid, 'http://ilyarrl2.beget.tech','http://re-wp.by'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://ilyarrl2.beget.tech', 'http://re-wp.by'); | |
update_option( 'siteurl', 'http://ilyarrl2.beget.tech' ); | |
update_option( 'home', 'http://ilyarrl2.beget.tech' ); | |
//**замена адрема после переноса |
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
<? | |
function getAllDiscounts() | |
{ | |
Bitrix\Main\Loader::includeModule('sale'); | |
require_once ($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/handlers/discountpreset/simpleproduct.php"); | |
$arDiscounts = array(); | |
$arProductDiscountsObject = \Bitrix\Sale\Internals\DiscountTable::getList(array( | |
'filter' => array( | |
'=ACTIVE' => 'Y', | |
// 'ID' => 1231, |
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
#Плагины | |
https://github.com/barryvdh/laravel-ide-helper | |
https://github.com/barryvdh/laravel-debugbar | |
#Модели | |
php artisan make:model Models/BlogPost #создать модель | |
php artisan make:model Models/BlogPost -m #создать модель и миграцию для нее | |
#Очистить кеш | |
php artisan config:cache |
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\Loader::includeModule('iblock'); | |
$iblock = \Bitrix\Iblock\Iblock::wakeUp(3); | |
$class = $iblock->getEntityDataClass(); | |
$arResult = []; | |
$elements = $class::getList([ | |
'select' => ['ID', 'IBLOCK_ID', 'XML_ID', 'ARTICLE'], | |
//'limit' => 5000, | |
'order' => ['ID' => 'ASC'] |
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\Loader::includeModule('iblock'); | |
$getCountValues = function ($propId){ | |
$res = \Bitrix\Iblock\ElementPropertyTable::getList([ | |
'select' => ['*'], | |
'filter' => ['ELEMENT.IBLOCK_ID' => 23, 'IBLOCK_PROPERTY_ID' => $propId], | |
'count_total' => true, | |
]); | |
return $res->getCount(); |
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
<? | |
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; |
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
sudo dnf groupinstall "Development Tools" | |
sudo dnf groupinstall "C Development Tools and Libraries" | |
sudo dnf install dkms elfutils-libelf-devel unzip | |
git clone https://github.com/aircrack-ng/rtl8812au.git | |
cd rtl8812au |
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
use Bitrix\Main\ORM\Entity; | |
use Bitrix\Main\ORM\Fields\IntegerField; | |
use Bitrix\Main\ORM\Fields\StringField; | |
use Bitrix\Main\ORM\Query\Filter\ConditionTree; | |
use Bitrix\Main\ORM\Query\Query; | |
// Создаём фейковую сущность только с нужными нам полями | |
$fakeEntity = Entity::compileEntity( | |
'MY_ORDER_PROPS_VARIANT', | |
[ |
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
#сбросить все измененния и откатится | |
git reset --hard HEAD | |
git clean -fd | |
#удалить файл из git | |
git rm -r --cached <path> |
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
https://estrin.pw/bitrix-d7-snippets/s/current-user-is-authorized/ | |
if(\Bitrix\Main\Engine\CurrentUser::get()->getId()) | |
{} | |
\Bitrix\Main\Engine\CurrentUser::get()->isAdmin() | |
\Bitrix\Main\Engine\CurrentUser::get()->getLogin() | |
//лого без ссылки на главной | |
<? $isIndex = ($APPLICATION->GetCurPage(false) == SITE_DIR)?> | |
<?if (!$isIndex):?> |
OlderNewer