Евгений

Евгений

С нами с 07 февраля 2013; Место в рейтинге пользователей: #313
24 мая 2023, 21:40
0
а как сделать так чтобы он удалял именно конструкцию word1 а не просто word?
24 мая 2023, 19:14
0
с tvsuperselct вид тв поля какой нужен
24 мая 2023, 19:10
0
тоже не понял но там и на другие снипеты орал
24 мая 2023, 16:42
0
/core/components/gallery/elements/tv/output/ выдает такую ошибку при сохранении с этой строкой
24 мая 2023, 15:37
0
создал тв поле migx добавил слова testx testy в tv и в поле контент

<?php
switch ($modx->event->name) {
        case 'OnDocPublished':
        case 'OnBeforeDocFormSave':
        case 'OnDocFormSave':
            if ($resource->get('template') == 24 && !$resource->get('content')) $resource->set('published', 0);
            $res = $modx->getObject('modResource', 11);
            $words = $res->getTVValue('words'); // тут получить слова, распарсить строку, смотря что там вернет.
           
            $content = $resource->get('content');
            $pattern = '/(?:' . join('|', $words) . ')/i';
            $content = preg_replace($pattern, '', $content);
            
            $resource->set('content', $content);
            $resource->save();
        break;
              
}
но увы не подчищает
может разделитель в параметрах вывода TV или чтото в коде не так? как найти причину непонятно
24 мая 2023, 11:29
0
а как обратиться к TV определенного ресурса ))))
например у него id=11 и TV со словами будет в нем
23 мая 2023, 23:28
0
tv я думаю вбить в одном ресурсе и к нему обращаться будет проще
22 января 2023, 17:21
0
а как переносить не все, оставлять 10 последних?
14 ноября 2022, 14:33
0
сумбурно описал так как не мог понять как это вообще лучше реализовать
решил написать скрипт js который подменяет ref url на красивую «внутреннюю» ссылку, собственно думаю плагины не понадобятся
12 ноября 2022, 17:24
0
нашел CloakLinks для EVO
может есть подобное для REVO?
12 ноября 2022, 13:23
0
вот как здесь например кнопка перейти на сайт
такой плагин на wp как я понимаю есть
18 октября 2022, 12:18
0
подправил для поле tvFilters
<?php
$filterz = '';
if(isset($_GET['types'])) $filterz = $filterz.'types=='.$_GET['types'].',';
if(isset($_GET['config'])) $filterz = $filterz.'config=='.$_GET['config'].',';
if(isset($_GET['style'])) $filterz = $filterz.'style=='.$_GET['style'].',';
if(isset($_GET['fasad'])) $filterz = $filterz.'fasad=='.$_GET['fasad'].',';

if($filterz !=='') $filterz = substr($filterz,0,-1);

return $filterz;
словил такую ошибку
[pdoTools] Error 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"`TVtypes`.`value` LIKE '1\"' AND  ( `msProduct`.`parent` IN (2,24,5,6,7,8,9,10,' at line 1
18 октября 2022, 11:48
0
пришел к такому решению:
[[!msProducts? &tpl=`tovartplCat` &limit=`64` &parents=`2` &tvFilters=`[[!where]]` &includeTVs=`types,config,style,fasad` ]]
<?php
$filterz = '';
if(isset($_GET['types'])) $filterz['types'] = $_GET['types'];
if(isset($_GET['config'])) $filterz['config'] = $_GET['config'];
if(isset($_GET['style'])) $filterz['style'] = $_GET['style'];
if(isset($_GET['fasad'])) $filterz['fasad'] = $_GET['fasad'];
if($filterz !=='') $filterz = substr($filterz,0,-1);

//if(!empty($filterz)) {$where = json_encode($filterz);} else {$where = '';}

return $filterz;
но чтото не завелось :(
12 октября 2022, 15:35
0
нету ничего такого у меня
12 октября 2022, 12:03
0
добавил, а где лог смотреть? в логе ошибок тоже самое все
12 октября 2022, 11:03
0
добавил правки под новую
if(isset($_GET['types'])){$filterz[] = 'types=' . $_GET['types'];}
if(isset($_GET['config'])){$filterz[] = 'config=' . $_GET['config'];}
if(isset($_GET['style'])){$filterz[] = 'style=' . $_GET['style'];}
if(isset($_GET['fasad'])){$filterz[] = 'fasad=' . $_GET['fasad'];}
и where

if(isset($filterz)) { $where = $modx->toJSON(array($filterz)); } else { $where = ''; }
if(isset($filterz)) {
        $modx->log(1,print_r($filterz,1));
	$where = $modx->toJSON(array($filterz));
}
в итоге получаю в лог такое
[2022-10-12 06:31:26] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/37.include.cache.php : 28) Array
(
    [0] => types=1
    [1] => config=1
    [2] => style=1
    [3] => fasad=1
)
ну и в результатах фильтрации 0
12 октября 2022, 11:03
0
вернулся
сайт где работает на 7.4.28
на сайте где 7.4.32 не работает
пробовал и старее весрии ставить не помогло
10 октября 2022, 13:20
0
modx 2.8.4
PHP Version 8.0.24 была ранее 7,4 это ничего не меняло
mysql 5.7.36-39

pdotools 2.13.2-pl
minishop 3.0.6-pl

в целом на хосте несколько сайтов, но там нет такого фильтра
10 октября 2022, 12:17
0
вот такое при обновлении страницы и потом нажатии чекбоксов в фильтре, что это?
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 7) PHP warning: Undefined array key "types"
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 10) PHP warning: Undefined array key "config"
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 13) PHP warning: Undefined array key "style"
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 16) PHP warning: Undefined array key "fasad"
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 23) PHP warning: Undefined array key "sortby"
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 28) PHP warning: Undefined array key "sortdir"
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 37) PHP warning: Undefined array key "offset"
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/cartsessionhandler.class.php : 15) PHP warning: Undefined array key "minishop2"
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/cartsessionhandler.class.php : 15) PHP warning: Trying to access array offset on value of type null
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/ordersessionhandler.class.php : 22) PHP warning: Undefined array key "minishop2"
[2022-10-10 09:15:12] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/components/minishop2/handlers/storage/session/ordersessionhandler.class.php : 22) PHP warning: Trying to access array offset on value of type null
[2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 10) PHP warning: Undefined array key "config"
[2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 13) PHP warning: Undefined array key "style"
[2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 16) PHP warning: Undefined array key "fasad"
[2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 37) PHP warning: Undefined array key "offset"
[2022-10-10 09:15:34] (ERROR @ /home/host1834153/maltipuhome.ru/htdocs/www/core/cache/includes/elements/modsnippet/35.include.cache.php : 47) Array
(
    [0] => types=1
)