Оптимизировать сайт на DLE
blocbaster 19.08.2015 Стол заказов 1754 2 комментария
Добрый день. Нужно оптимизировать сайт на DLE, пару дней как начались проблемы, из за сайта падает сервер. Не понятно, что вызывает проблему, то ли БД, или еще что.
blocbaster 19.08.2015 Стол заказов 1754 2 комментария
Fatal error: Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in /home/imha/web/imha.ru/public_html/engine/modules/show.short.php:666 Stack trace: #0 /home/imha/web/imha.ru/public_html/engine/modules/show.short.php(666): explode(',', Array) #1 /home/imha/web/imha.ru/public_html/engine/engine.php(1167): include_once('/home/imha/web/...') #2 /home/imha/web/imha.ru/public_html/engine/init.php(1036): include_once('/home/imha/web/...') #3 /home/imha/web/imha.ru/public_html/index.php(19): require_once('/home/imha/web/...') #4 {main} thrown in /home/imha/web/imha.ru/public_html/engine/modules/show.short.php on line 666 Fatal error: Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in /home/imha/web/imha.ru/public_html/engine/modules/show.full.php:1265 Stack trace: #0 /home/imha/web/imha.ru/public_html/engine/modules/show.full.php(1265): explode(',', Array) #1 /home/imha/web/imha.ru/public_html/engine/engine.php(956): include_once('/home/imha/web/...') #2 /home/imha/web/imha.ru/public_html/engine/init.php(1036): include_once('/home/imha/web/...') #3 /home/imha/web/imha.ru/public_html/index.php(19): require_once('/home/imha/web/...') #4 {main} thrown in /home/imha/web/imha.ru/public_html/engine/modules/show.full.php on line 1265
DLEXFields::Compile($row, $tpl, $xfields_in_news, $all_xf_content);if (strpos($tpl->copy_template, '[first-match]') !== false) {
$tags = array_flip(array_filter(array_map(fn($v) => dle_strtolower(trim($v)), explode(',', $row['tags'] ?? ''))));
$tpl->copy_template = preg_replace_callback('~\[first-match\](.*?)\[/first-match\]~is', function($m) use ($tags) {
preg_match_all('~\[if\s+tags=["\']([^"\']+)["\']\](.*?)\[/if\]~is', $m[1], $ifs, PREG_SET_ORDER);
foreach ($ifs as $if)
foreach (explode(',', $if[1]) as $tag)
if (isset($tags[dle_strtolower(trim($tag))])) return $if[2];
return '';
}, $tpl->copy_template);
}[first-match]
[if tags="tag1"]Картинка 1[/if]
[if tags="tag2"]Картинка 2[/if]
[if tags="tag3"]Картинка 3[/if]
[/first-match]