Что нового

Как вывести изображение поста ({image-1}) на странице комментариев

Было подправлено, я не учел что при доп поле вида загружаемое изображение в базе хранится в таком виде
2024-12/logo.webp поэтому нужно просто добавить префикс
Код:
$posterUrl = '/uploads/posts/' . $posterUrl;
*** Скрытый текст не может быть процитирован. ***
При включении древовидных комментариев возникла ошибка.

PHP:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function DLE_Comments::compile_comment(), 4 passed in /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php on line 114 and exactly 5 expected in /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php:174 Stack trace: #0 /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php(114): DLE_Comments->compile_comment(Object(dle_template), Array, 'news', 0) #1 /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php(1110): DLE_Comments->compile_tree(Array, 'news') #2 /home1/public_html/engine/modules/show.full.php(2759): DLE_Comments->build_comments('comments.tpl', 'news', false, 'https://site...') #3 /home1/public_html/engine/engine.php(1026): include_once('/home1/...') #4 /home1/public_html/engine/init.php(1108): include_once('/home1/...') #5 /home1/public_html/index.php(19): require_once('/home1/...') #6 {main} thrown in /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php on line 174

114 line:

Код:
$item .= "<li id=\"comments-tree-item-{$node['id']}\" class=\"comments-tree-item\" >" . $this->compile_comment($tpl, $node, $area, $indent). "</li>";

174 line пустая строка в файле плагина a comments.class.php:

Код:
if( !$row['is_register'] OR $row['name'] == '' ) {
 
При включении древовидных комментариев возникла ошибка.

PHP:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function DLE_Comments::compile_comment(), 4 passed in /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php on line 114 and exactly 5 expected in /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php:174 Stack trace: #0 /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php(114): DLE_Comments->compile_comment(Object(dle_template), Array, 'news', 0) #1 /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php(1110): DLE_Comments->compile_tree(Array, 'news') #2 /home1/public_html/engine/modules/show.full.php(2759): DLE_Comments->build_comments('comments.tpl', 'news', false, 'https://site...') #3 /home1/public_html/engine/engine.php(1026): include_once('/home1/...') #4 /home1/public_html/engine/init.php(1108): include_once('/home1/...') #5 /home1/public_html/index.php(19): require_once('/home1/...') #6 {main} thrown in /home1/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php on line 174

114 line:

Код:
$item .= "<li id=\"comments-tree-item-{$node['id']}\" class=\"comments-tree-item\" >" . $this->compile_comment($tpl, $node, $area, $indent). "</li>";

174 line пустая строка в файле плагина a comments.class.php:

Код:
if( !$row['is_register'] OR $row['name'] == '' ) {
Обновленная версия которая должна решить проблему
 
Обновленная версия которая должна решить проблему
*** Скрытый текст не может быть процитирован. ***
Fatal error: Uncaught ArgumentCountError: Too few arguments to function DLE_Comments::compile_comment(), 4 passed in /home1/zseiaamy/public_html/engine/cache/system/plugins/d8fb77214e86fdda905b9d4b97259d4c.php on line 108

Untitled-2.png
 
да..обе эти строки необходимо было скорректировать

if (isset($node['children']) AND $next ) {

$item .= "<li id=\"comments-tree-item-{$node['id']}\" class=\"comments-tree-item\" >" . $this->compile_comment($tpl, $node, $area, $indent);
$item .= $this->compile_tree($node['children'], $area, $next, $indent + 1);
$item .= "</li>";

} else {

$item .= "<li id=\"comments-tree-item-{$node['id']}\" class=\"comments-tree-item\" >" . $this->compile_comment($tpl, $node, $area, $indent). "</li>";

if (isset($node['children'])) {
$item .= $this->compile_tree($node['children'], $area, $next, $indent + 1);
}

}
 
попробуйте это
  • kartinki-v-kommentarijah (2).zip
    1.8 КБ · ID: 4922
 
Последнее редактирование:
странно у меня работает, все выводит значит тут индивидуально надо смотреть почему так.
 
Верх