Describe the technical changes you did.
Describe the issue you are solving.
Let us know if this is related to any issue/ticket/pull request.
| <?php | |
| /** | |
| Скрипт, который позволяет принимать запросы от shopmanager и обновлять информацию на сайте на базе MODX и miniSgop2, | |
| при включенной интеграции. | |
| Скрипт не закончен, потому использовать на свой страх и риск. | |
| */ | |
| declare(strict_types = 1); |
| <?php | |
| if ('OnManagerPageBeforeRender' !== $modx->event->name) { | |
| return; // exit if any other event happened | |
| } | |
| if ('system/settings' !== $_GET['a']) { | |
| return; // exit if any other page than system settings loaded | |
| } |
| $get = $modx->sanitize($_GET); | |
| if (!$get['day']) { | |
| $now = time(); | |
| $day = date('Y-m-d', $now); | |
| } | |
| $day = $get['day']; | |
| $step = 15; // minutes |
| MYSQL_PORT=33060 | |
| NGINX_PORT=80 | |
| PROJECT_NAME=tao |
| #!/bin/bash | |
| flag=5 | |
| if [ ! $1 ]; then | |
| echo "Set user name for connect to mysql" | |
| let flag=flag-1 | |
| fi | |
| if [ ! $2 ]; then |
| <?php | |
| $str = 'fD3_'; | |
| $chars = array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9'), ['_']); | |
| $total = 0; | |
| $brut = ''; | |
| $len = strlen($str); | |
| /** | |
| * @see: https://www.programmingalgorithms.com/algorithm/brute-force?lang=PHP | |
| */ |
| <?php | |
| // обрабатываем только события OnPageNotFound, на случай, если отметили галкой и другие в настройках плагина | |
| if ($modx->event->name != 'OnPageNotFound') { | |
| return false; | |
| } | |
| // на случай, если у нас настройки кто-то менял, получаем значение переменной, через которую передаются ссылки в modx от веб-сервера | |
| $alias = $modx->context->getOption('request_param_alias', 'q'); |
| <?php | |
| switch ($modx->event->name) { | |
| case 'OnDocFormSave': | |
| if ($resource->get('template') === 5) { // event | |
| $start = $resource->getTVValue('event.start'); | |
| $finish = $resource->getTVValue('event.finish'); | |
| if ($start && $finish) { // o both empty or both filled, that means OK | |
| return; | |
| } |
[[!pdoResources?
&tpl=@INLINE {{+id}} {{+pagetitle}}
&select={"modResource":"id,pagetitle"}
&parents=0
&leftJoin={ "modResourceGroupResource": {"on":"modResourceGroupResource.document = modResource.id"}, "modResourceGroup": {"on":"modResourceGroup.id = modResourceGroupResource.document_group"} }
&where={"modResourceGroup.name":"test"}
]]