Witam,
Koncze właśnie cms na skrypcie szablonów JustIT, jest ony wygodny w użyciu ale mam problem...
Gdy w tekscie dam np.
to zamieni mi to podczas wyświetlania na
test
</a>">
<a href="#">test
</a>
zapewne dzieje się tak przez funkcje odpowiedzialną za wyświetlanie w klasie szablonu (bo w bazie teskt wygląda poprawnie).
Funkcja odpowiadająca za wyświetlanie...
function display_body()
{
if ( !$this->status ) return false;
$indexes = $loops = $used_loops = array();
if ( count($this->used_indexes) )
{
foreach($this->used_indexes as $key => $value)
{
$name = explode('.', $key);
$name = $name[(count($name)-1)];
if ( $value > 1 )
{
if ( @!in_array($name, $indexes) )
{
$indexes[] = $name;
}
if ( $value > $loops[$name] )
{
$loops[$name] = $value;
}
}
if ( @!in_array($name, $used_loops) )
{
$value = intval($value);
fputs($this->variables_file_handler, '$tplvar_loop_max_' . $this->unique_hash . '_' . $name . " = '$value';n");
$used_loops[] = $name;
}
}
}
fputs($this->variables_file_handler, '?>');
@fclose($this->variables_file_handler);
if ( count($this->used_variables) )
{
$var_file_contents = trim(file_get_contents($this->variables_file));
$var_file_contents_with_globals = str_replace('
<?php', '<?php global ' . implode(', ', $this->used_variables) . ';', $var_file_contents);
$this->variables_file_handler = @fopen($this->variables_file, 'w+') or $this->error_msg(54, 'Couldn't handle variables file.');
@fputs($this->variables_file_handler, $var_file_contents_with_globals); @fclose($this->variables_file_handler); }
$this->template_filesize = @filesize($this->template_file); $this->template_file_contents = trim(@fread($this->template_file_handler, $this->template_filesize)); @fclose($this->template_file_handler);
if ( $this->enabled_php_scripts === false )
{
$this->template_file_contents = preg_replace('#<?(.*?)?>#is', '<?1?>', $this->template_file_contents); $this->template_file_contents = preg_replace('#<?xml(.*?)?>#is', '<?xml1?>', $this->template_file_contents); }
$variables = $required_variables = array(); if ( !$this->template_file_contents )
{
message_die(53, 'Template file is empty.');
}
preg_match_all('#{(([0-9a-z_]|.)+)}#i', $this->template_file_contents, $variables); preg_match_all('#<!-- BEGIN (([0-9a-z_])+) -->#i', $this->template_file_contents, $offsets);
foreach ( $variables[1] as $index => $variable )
{
$this->template_file_contents = str_replace($variables[0
][$index], '<?php print ' . $this->convert_tplvars($variable) . '; ?>', $this->template_file_contents); $required_variables[] = $this->convert_tplvars($variable,1);
}
foreach ( $offsets[1] as $index => $offset )
{
preg_match_all('#<!-- BEGIN ' . trim($offset) . ' -->(.*?)<!-- END ' . trim($offset) . ' -->#s', $this->template_file_contents, $fields); foreach ( $fields[1] as $index => $content )
{
$loop_var = '$tplvar_loop_' . $this->unique_hash . '_' . $offset;
$loop_max_var = '$tplvar_loop_max_' . $this->unique_hash . '_' . $offset;
$replacement_a = '<?php for ( ' . $loop_var . ' = 0; ' . $loop_var . ' < ' . $loop_max_var . '; ' . $loop_var . '++ )';
$replacement_a .= "n{ ?>n";
$replacement_b = "n<?php } ?>n";
$this->template_file_contents = str_replace($fields[0
][$index], $replacement_a . $content . $replacement_b, $this->template_file_contents); }
}
if ( count($required_variables) ) {
foreach( $required_variables as $var )
{
if ( @!in_array($var, $this->used_variables) && @!in_array($var, $global_vars) ) {
$global_vars[] = $var;
}
}
}
if ( count($global_vars) ) {
$this->template_file_contents = "<?php global " . implode(',', $global_vars) . "; ?>nn" . $this->template_file_contents; }
@fputs($this->cache_file_handler, $this->template_file_contents); @fclose($this->cache_file_handler);
unset($this->used_indexes, $this->template_file_contents, $this->used_variables);
if ( !include($this->variables_file) )
{
$this->error_msg(51, 'Couldn't assign cache
file.'); }
unlink($this->variables_file);
if ( !include($this->cache_file) )
{
$this->error_msg(52, 'Couldn't assign template cache file.');
}
$this->status = 0;
}