После включения показа ошибок :
Запусти этот код (+/-)
<?php
define('_IN_JOHNCMS', 1);
include 'incfiles/core.php';
$error = []; #<---Объявление массива НЕ удалять!
$last_id = $id;
$text = isset($_POST['text']) ? functions::checkin($_POST['text']) : '';
if (empty($text)) {
$error[] = 'Введите текст сообщения!';
} elseif (mb_strlen($text) < 10) {
$error[] = 'Слишком короткий текст!';
}
if (!empty($error)) {
$ref = functions::checkin($_SERVER['HTTP_REFERER']) ;
echo functions::display_error($error, '<a href="'. $ref .'">Назад</a>');
} else {
$sql = "
INSERT INTO `cms_news_comments`
SET
`refid` = '$last_id',
`time` = '" . time() . "',
`user_id` = '" . $user_id . "',
`text` = '" . mysql_real_escape_string($text) . "'
";
mysql_query($sql) or die (mysql_error());
$_SESSION['error'] = '<div class="gmenu">'. $lng_news['added_message'] .'</div>';
}