Ecco l'ultima parte:
Codice PHP:
/**
* Remove starting and ending quotes from the string
*
* @param string $string
* @return string
*/
function _dequote($string)
{
if ((substr($string, 0, 1) == "'" || substr($string, 0, 1) == '"') &&
substr($string, -1) == substr($string, 0, 1))
return substr($string, 1, -1);
else
return $string;
}
/**
* read in a file
*
* @param string $filename
* @return string
*/
function _read_file($filename)
{
if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) {
$contents = '';
while (!feof($fd)) {
$contents .= fread($fd, 8192);
}
fclose($fd);
return $contents;
} else {
return false;
}
}
/**
* get a concrete filename for automagically created content
*
* @param string $auto_base
* @param string $auto_source
* @param string $auto_id
* @return string
* @staticvar string|null
* @staticvar string|null
*/
function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null)
{
$_compile_dir_sep = $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';
$_return = $auto_base . DIRECTORY_SEPARATOR;
if(isset($auto_id)) {
// make auto_id safe for directory names
$auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id)));
// split into separate directories
$_return .= $auto_id . $_compile_dir_sep;
}
if(isset($auto_source)) {
// make source name safe for filename
$_filename = urlencode(basename($auto_source));
$_crc32 = sprintf('%08X', crc32($auto_source));
// prepend %% to avoid name conflicts with
// with $params['auto_id'] names
$_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep .
substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32;
$_return .= '%%' . $_crc32 . '%%' . $_filename;
}
return $_return;
}
/**
* unlink a file, possibly using expiration time
*
* @param string $resource
* @param integer $exp_time
*/
function _unlink($resource, $exp_time = null)
{
if(isset($exp_time)) {
if(time() - @filemtime($resource) >= $exp_time) {
return @unlink($resource);
}
} else {
return @unlink($resource);
}
}
/**
* returns an auto_id for auto-file-functions
*
* @param string $cache_id
* @param string $compile_id
* @return string|null
*/
function _get_auto_id($cache_id=null, $compile_id=null) {
if (isset($cache_id))
return (isset($compile_id)) ? $cache_id . '|' . $compile_id : $cache_id;
elseif(isset($compile_id))
return $compile_id;
else
return null;
}
/**
* trigger Smarty plugin error
*
* @param string $error_msg
* @param string $tpl_file
* @param integer $tpl_line
* @param string $file
* @param integer $line
* @param integer $error_type
*/
function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
$file = null, $line = null, $error_type = E_USER_ERROR)
{
if(isset($file) && isset($line)) {
$info = ' ('.basename($file).", line $line)";
} else {
$info = '';
}
if (isset($tpl_line) && isset($tpl_file)) {
$this->trigger_error('[in ' . $tpl_file . ' line ' . $tpl_line . "]: $error_msg$info", $error_type);
} else {
$this->trigger_error($error_msg . $info, $error_type);
}
}
/**
* callback function for preg_replace, to call a non-cacheable block
* @return string
*/
function _process_compiled_include_callback($match) {
$_func = '_smarty_tplfunc_'.$match[2].'_'.$match[3];
ob_start();
$_func($this);
$_ret = ob_get_contents();
ob_end_clean();
return $_ret;
}
/**
* called for included templates
*
* @param string $_smarty_include_tpl_file
* @param string $_smarty_include_vars
*/
// $_smarty_include_tpl_file, $_smarty_include_vars
function _smarty_include($params)
{
if ($this->debugging) {
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$debug_start_time = smarty_core_get_microtime($_params, $this);
$this->_smarty_debug_info[] = array('type' => 'template',
'filename' => $params['smarty_include_tpl_file'],
'depth' => ++$this->_inclusion_depth);
$included_tpls_idx = count($this->_smarty_debug_info) - 1;
}
$this->_tpl_vars = array_merge($this->_tpl_vars, $params['smarty_include_vars']);
// config vars are treated as local, so push a copy of the
// current ones onto the front of the stack
array_unshift($this->_config, $this->_config[0]);
$_smarty_compile_path = $this->_get_compile_path($params['smarty_include_tpl_file']);
if ($this->_is_compiled($params['smarty_include_tpl_file'], $_smarty_compile_path)
|| $this->_compile_resource($params['smarty_include_tpl_file'], $_smarty_compile_path))
{
include($_smarty_compile_path);
}
// pop the local vars off the front of the stack
array_shift($this->_config);
$this->_inclusion_depth--;
if ($this->debugging) {
// capture time for debugging info
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time;
}
if ($this->caching) {
$this->_cache_info['template'][$params['smarty_include_tpl_file']] = true;
}
}
/**
* get or set an array of cached attributes for function that is
* not cacheable
* @return array
*/
function &_smarty_cache_attrs($cache_serial, $count) {
$_cache_attrs =& $this->_cache_info['cache_attrs'][$cache_serial][$count];
if ($this->_cache_including) {
/* return next set of cache_attrs */
$_return = current($_cache_attrs);
next($_cache_attrs);
return $_return;
} else {
/* add a reference to a new set of cache_attrs */
$_cache_attrs[] = array();
return $_cache_attrs[count($_cache_attrs)-1];
}
}
/**
* wrapper for include() retaining $this
* @return mixed
*/
function _include($filename, $once=false, $params=null)
{
if ($once) {
return include_once($filename);
} else {
return include($filename);
}
}
/**
* wrapper for eval() retaining $this
* @return mixed
*/
function _eval($code, $params=null)
{
return eval($code);
}
/**#@-*/
}
/* vim: set expandtab: */
?>
Come potete aiutarmi? Mi rendo conto che il codice è molto lungo ma voi se volete aiutarmi copiate tutto il codice e incollatelo in un file di testo.
Per comodità ora vi posto le righe di codice che danno il problema:
Codice PHP:
function trigger_error($error_msg, $error_type = E_USER_WARNING)
{
trigger_error("Smarty error: $error_msg", $error_type);
}
la terza riga;
Codice PHP:
{
include('$_smarty_compile_path');
}
la seconda.
Vi ringrazio in anticipo!
Ciao a tutti
steave67