⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 core.process_cached_inserts.php

📁 转载中国源码下载站 1) 基于PHP语言开发,MYSQL数据库驱动的多用户留言本 2) 采用PHP官方提供的编译模板引擎smarty 3) 代码、页面分离
💻 PHP
字号:
<?php/** * Smarty plugin * @package Smarty * @subpackage plugins *//** * Replace cached inserts with the actual results * * @param string $results * @return string */    function smarty_core_process_cached_inserts($params, &$smarty){    preg_match_all('!'.$smarty->_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis',                   $params['results'], $match);    list($cached_inserts, $insert_args) = $match;    for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {        if ($smarty->debugging) {			$_params = array();			require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');            $debug_start_time = smarty_core_get_microtime($_params, $smarty);        }        $args = unserialize($insert_args[$i]);        $name = $args['name'];        if (isset($args['script'])) {			$_params = array('resource_name' => $smarty->_dequote($args['script']));			require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_php_resource.php');			if(!smarty_core_get_php_resource($_params, $smarty)) {				return false;			}			$resource_type = $_params['resource_type'];			$php_resource = $_params['php_resource'];            if ($resource_type == 'file') {                $smarty->_include($php_resource, true);            } else {                $smarty->_eval($php_resource);            }        }        $function_name = $smarty->_plugins['insert'][$name][0];        $replace = $function_name($args, $smarty);        $params['results'] = str_replace($cached_inserts[$i], $replace, $params['results']);        if ($smarty->debugging) {			$_params = array();			require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');            $smarty->_smarty_debug_info[] = array('type'      => 'insert',                                                'filename'  => 'insert_'.$name,                                                'depth'     => $smarty->_inclusion_depth,                                                'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time);        }    }    return $params['results'];}/* vim: set expandtab: */?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -