PROGRAMMATOR, не знаю как у тебя, посмотрев исходники DLE 8.0 то сразу понял там бы твой пример не сработал бы.
PHP код:
$this->template = preg_replace( "#\\{include file=['\"](.+?)['\"]\\}#ies", "\$this->sub_load_template('\\1')", $this->template );
PHP код:
function sub_load_template($tpl_name) {
$tpl_name = totranslit( $tpl_name );
if( $tpl_name == '' || ! file_exists( $this->dir . DIRECTORY_SEPARATOR . $tpl_name ) ) {
die( "Невозможно загрузить шаблон: " . $tpl_name );
return false;
}
$template = file_get_contents( $this->dir . DIRECTORY_SEPARATOR . $tpl_name );
return $template;
}
Отсюда стало ясно что данный тег просто бы грузил файл шаблона и не более.
Хотя в новой версии может уже и работает...
Добавлено через 4 минуты
Да, проблема кроется иммено в ранних версиях.
В ДЛЕ 8.3 уже другой код.
PHP код:
$this->template = preg_replace( "#\\{include file=['\"](.+?)['\"]\\}#ies", "\$this->load_file('\\1', 'tpl')", $this->template );
PHP код:
function load_file( $name, $include_file = "tpl" ) {
global $db, $is_logged, $member_id, $cat_info, $config, $user_group, $category_id, $_TIME, $lang, $smartphone_detected, $dle_module;
$name = str_replace( '..', '', $name );
$url = @parse_url ($name);
$type = explode( ".", $url['path'] );
$type = strtolower( end( $type ) );
if ($type == "tpl") {
return $this->sub_load_template( $name );
}
if ($include_file == "php") {
if ( !$this->allow_php_include ) return;
if ($type != "php") return "Для подключения допускаются только файлы с расширением .tpl или .php";
if ($url['path']{0} == "/" )
$file_path = dirname (ROOT_DIR.$url['path']);
else
$file_path = dirname (ROOT_DIR."/".$url['path']);
$file_name = pathinfo($url['path']);
$file_name = $file_name['basename'];
if ( stristr ( php_uname( "s" ) , "windows" ) === false )
$chmod_value = @decoct(@fileperms($file_path)) % 1000;
if ($chmod_value == 777 ) return "Файл {$url['path']} находится в папке, которая доступна для записи (CHMOD 777). В целях безопасности подключение файлов из таких папок невозможно. Измените права на папку, чтобы на нее небыло прав на запись.";
if ( !file_exists($file_path."/".$file_name) ) return "Файл {$url['path']} не найден, его загрузка невозможна.";
if ( $url['query'] ) {
parse_str( $url['query'] );
}
ob_start();
$tpl = new dle_template( );
$tpl->dir = TEMPLATE_DIR;
include $file_path."/".$file_name;
return ob_get_clean();
}
return '{include file="'.$name.'"}';
}