This file contains hidden or 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
<?php | |
// ********************************* // | |
/** @var mindbox $mindbox */ | |
$modx->loadClass('modMindbox', MODX_CORE_PATH . 'components/mindbox/model/', true, true); | |
$mindbox = new modMindbox($modx, []); | |
if (!$mindbox) { | |
return 'Could not load modMindbox class!'; | |
} | |
$q = $modx->newQuery('msOrder', [ |
This file contains hidden or 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
{set $goods = 'msProducts' | snippet : [ | |
'sortby' => '{"null_total_remains":"DESC", "menuindex":"DESC"}', | |
'tpl' => 'good.category3', | |
'leftJoin' => [ | |
"remains" => [ | |
"class" => "modTemplateVarResource", | |
"on" => "msProduct.id = remains.contentid AND remains.tmplvarid IN (29,30,31,32,33,34,52)" // id TV с остатками | |
], | |
], | |
'select' => [ |
This file contains hidden or 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
<?php | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
class AddRoleIdToUsersTable extends Migration | |
{ | |
public function up() | |
{ |
This file contains hidden or 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
<?php | |
// Перед этим в консоли "cd core/components && mkdir sentry && composer require sentry/sdk" | |
switch ($modx->event->name) { | |
case 'OnMODXInit': | |
$file = MODX_CORE_PATH.'components/sentry/vendor/autoload.php'; | |
if (file_exists($file)) { | |
require_once $file; | |
} | |
break; | |
case 'OnWebPageInit': |
This file contains hidden or 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
<?php | |
switch ($modx->event->name) { | |
case 'msOnGetStatusCart': | |
$values = & $modx->event->returnedValues; | |
$values['status'] = $status; | |
$values['status']['real_total_cost'] = $status['total_cost'] + $status['total_discount']; | |
break; | |
} |
This file contains hidden or 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
<?php | |
$dob = $hook->getValue('dob'); | |
if (!empty($dob)) { | |
$hook->setValue('dob', strtotime($dob)); | |
} | |
return true; |
This file contains hidden or 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
<?php | |
$modx->filterPathSegment($caption, ['friendly_alias_word_delimiter' => '_', 'friendly_alias_restrict_chars' => 'alpha']); |
This file contains hidden or 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
{'!Localizator' | snippet : [ | |
'snippet' => 'msProducts', | |
'tpl' => 'good.like', | |
'leftJoin' => [ | |
"big_2" => [ | |
"class" => "msProductFile", | |
"alias" => "big_2", | |
"on" => "big_2.product_id = msProduct.id AND big_2.rank = 1 AND big_2.path LIKE '%/big/%'" | |
] | |
], |
This file contains hidden or 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
<?php | |
require MODX_CORE_PATH . 'components/modinstagram/vendor/autoload.php'; | |
use Phpfastcache\Helper\Psr16Adapter; | |
// If account is public you can query Instagram without auth | |
$instagram = \InstagramScraper\Instagram::withCredentials('user', 'password', new Psr16Adapter('Files')); | |
$instagram->login(); | |
$account = $instagram->getAccount('ig0r74'); |
NewerOlder