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

📄 .nfs0e5f801900000006

📁 基础原形来自 Ourplus,修补跨站脚本攻击漏洞 采用PHP+Mysql+Xml开发的网站流量统计分析系统 ,不影响页面下载速度。 本流量统计系统采用了高效的程序算法和精心优化的数据库结构
💻 NFS0E5F801900000006
📖 第 1 页 / 共 5 页
字号:
            $start_tag = false;            $tag_command = substr($tag_command, 1);        } else            $start_tag = true;        $found = false;        $have_function = true;        /*         * First we check if the block function has already been registered         * or loaded from a plugin file.         */        if (isset($this->_plugins['block'][$tag_command])) {            $found = true;            $plugin_func = $this->_plugins['block'][$tag_command][0];            if (!is_callable($plugin_func)) {                $message = "block function '$tag_command' is not implemented";                $have_function = false;            }        }        /*         * Otherwise we need to load plugin file and look for the function         * inside it.         */        else if ($plugin_file = $this->_get_plugin_filepath('block', $tag_command)) {            $found = true;            include_once $plugin_file;            $plugin_func = 'smarty_block_' . $tag_command;            if (!function_exists($plugin_func)) {                $message = "plugin function $plugin_func() not found in $plugin_file\n";                $have_function = false;            } else {                $this->_plugins['block'][$tag_command] = array($plugin_func, null, null, null, true);            }        }        if (!$found) {            return false;        } else if (!$have_function) {            $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);            return true;        }        /*         * Even though we've located the plugin function, compilation         * happens only once, so the plugin will still need to be loaded         * at runtime for future requests.         */        $this->_add_plugin('block', $tag_command);        if ($start_tag)            $this->_push_tag($tag_command);        else            $this->_pop_tag($tag_command);        if ($start_tag) {            $output = '<?php ' . $this->_push_cacheable_state('block', $tag_command);            $attrs = $this->_parse_attrs($tag_args);            $arg_list = $this->_compile_arg_list('block', $tag_command, $attrs, $_cache_attrs='');            $output .= "$_cache_attrs\$this->_tag_stack[] = array('$tag_command', array(".implode(',', $arg_list).')); ';            $output .= $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat=true);';            $output .= 'while ($_block_repeat) { ob_start(); ?>';        } else {            $output = '<?php $this->_block_content = ob_get_contents(); ob_end_clean(); ';            $_out_tag_text = $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], $this->_block_content, $this, $_block_repeat=false)';            if ($tag_modifier != '') {                $this->_parse_modifiers($_out_tag_text, $tag_modifier);            }            $output .= 'echo '.$_out_tag_text.'; } ';            $output .= " array_pop(\$this->_tag_stack); " . $this->_pop_cacheable_state('block', $tag_command) . '?>';        }        return true;    }    /**     * compile custom function tag     *     * @param string $tag_command     * @param string $tag_args     * @param string $tag_modifier     * @return string     */    function _compile_custom_tag($tag_command, $tag_args, $tag_modifier, &$output)    {        $found = false;        $have_function = true;        /*         * First we check if the custom function has already been registered         * or loaded from a plugin file.         */        if (isset($this->_plugins['function'][$tag_command])) {            $found = true;            $plugin_func = $this->_plugins['function'][$tag_command][0];            if (!is_callable($plugin_func)) {                $message = "custom function '$tag_command' is not implemented";                $have_function = false;            }        }        /*         * Otherwise we need to load plugin file and look for the function         * inside it.         */        else if ($plugin_file = $this->_get_plugin_filepath('function', $tag_command)) {            $found = true;            include_once $plugin_file;            $plugin_func = 'smarty_function_' . $tag_command;            if (!function_exists($plugin_func)) {                $message = "plugin function $plugin_func() not found in $plugin_file\n";                $have_function = false;            } else {                $this->_plugins['function'][$tag_command] = array($plugin_func, null, null, null, true);            }        }        if (!$found) {            return false;        } else if (!$have_function) {            $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);            return true;        }        /* declare plugin to be loaded on display of the template that           we compile right now */        $this->_add_plugin('function', $tag_command);        $_cacheable_state = $this->_push_cacheable_state('function', $tag_command);        $attrs = $this->_parse_attrs($tag_args);        $arg_list = $this->_compile_arg_list('function', $tag_command, $attrs, $_cache_attrs='');        $output = $this->_compile_plugin_call('function', $tag_command).'(array('.implode(',', $arg_list)."), \$this)";        if($tag_modifier != '') {            $this->_parse_modifiers($output, $tag_modifier);        }        if($output != '') {            $output =  '<?php ' . $_cacheable_state . $_cache_attrs . 'echo ' . $output . ';'                . $this->_pop_cacheable_state('function', $tag_command) . "?>" . $this->_additional_newline;        }        return true;    }    /**     * compile a registered object tag     *     * @param string $tag_command     * @param array $attrs     * @param string $tag_modifier     * @return string     */    function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier)    {        if ($tag_command{0} == '/') {            $start_tag = false;            $tag_command = substr($tag_command, 1);        } else {            $start_tag = true;        }        list($object, $obj_comp) = explode('->', $tag_command);        $arg_list = array();        if(count($attrs)) {            $_assign_var = false;            foreach ($attrs as $arg_name => $arg_value) {                if($arg_name == 'assign') {                    $_assign_var = $arg_value;                    unset($attrs['assign']);                    continue;                }                if (is_bool($arg_value))                    $arg_value = $arg_value ? 'true' : 'false';                $arg_list[] = "'$arg_name' => $arg_value";            }        }        if($this->_reg_objects[$object][2]) {            // smarty object argument format            $args = "array(".implode(',', (array)$arg_list)."), \$this";        } else {            // traditional argument format            $args = implode(',', array_values($attrs));            if (empty($args)) {                $args = 'null';            }        }        $prefix = '';        $postfix = '';        $newline = '';        if(!is_object($this->_reg_objects[$object][0])) {            $this->_trigger_fatal_error("registered '$object' is not an object" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);        } elseif(!empty($this->_reg_objects[$object][1]) && !in_array($obj_comp, $this->_reg_objects[$object][1])) {            $this->_trigger_fatal_error("'$obj_comp' is not a registered component of object '$object'", $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);        } elseif(method_exists($this->_reg_objects[$object][0], $obj_comp)) {            // method            if(in_array($obj_comp, $this->_reg_objects[$object][3])) {                // block method                if ($start_tag) {                    $prefix = "\$this->_tag_stack[] = array('$obj_comp', $args); ";                    $prefix .= "\$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], null, \$this, \$_block_repeat=true); ";                    $prefix .= "while (\$_block_repeat) { ob_start();";                    $return = null;                    $postfix = '';            } else {                    $prefix = "\$this->_obj_block_content = ob_get_contents(); ob_end_clean(); ";                    $return = "\$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], \$this->_obj_block_content, \$this, \$_block_repeat=false)";                    $postfix = "} array_pop(\$this->_tag_stack);";                }            } else {                // non-block method                $return = "\$this->_reg_objects['$object'][0]->$obj_comp($args)";            }        } else {            // property            $return = "\$this->_reg_objects['$object'][0]->$obj_comp";        }        if($return != null) {            if($tag_modifier != '') {                $this->_parse_modifiers($return, $tag_modifier);            }            if(!empty($_assign_var)) {                $output = "\$this->assign('" . $this->_dequote($_assign_var) ."',  $return);";            } else {                $output = 'echo ' . $return . ';';                $newline = $this->_additional_newline;            }        } else {            $output = '';        }        return '<?php ' . $prefix . $output . $postfix . "?>" . $newline;    }    /**     * Compile {insert ...} tag     *     * @param string $tag_args     * @return string     */    function _compile_insert_tag($tag_args)    {        $attrs = $this->_parse_attrs($tag_args);        $name = $this->_dequote($attrs['name']);        if (empty($name)) {            $this->_syntax_error("missing insert name", E_USER_ERROR, __FILE__, __LINE__);        }        if (!empty($attrs['script'])) {            $delayed_loading = true;        } else {            $delayed_loading = false;        }        foreach ($attrs as $arg_name => $arg_value) {            if (is_bool($arg_value))                $arg_value = $arg_value ? 'true' : 'false';            $arg_list[] = "'$arg_name' => $arg_value";        }        $this->_add_plugin('insert', $name, $delayed_loading);        $_params = "array('args' => array(".implode(', ', (array)$arg_list)."))";        return "<?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');\necho smarty_core_run_insert_handler($_params, \$this); ?>" . $this->_additional_newline;    }    /**     * Compile {include ...} tag     *     * @param string $tag_args     * @return string     */    function _compile_include_tag($tag_args)    {        $attrs = $this->_parse_attrs($tag_args);        $arg_list = array();        if (empty($attrs['file'])) {            $this->_syntax_error("missing 'file' attribute in include tag", E_USER_ERROR, __FILE__, __LINE__);        }        foreach ($attrs as $arg_name => $arg_value) {            if ($arg_name == 'file') {                $include_file = $arg_value;                continue;            } else if ($arg_name == 'assign') {                $assign_var = $arg_value;                continue;            }            if (is_bool($arg_value))                $arg_value = $arg_value ? 'true' : 'false';            $arg_list[] = "'$arg_name' => $arg_value";        }        $output = '<?php ';        if (isset($assign_var)) {            $output .= "ob_start();\n";        }        $output .=            "\$_smarty_tpl_vars = \$this->_tpl_vars;\n";        $_params = "array('smarty_include_tpl_file' => " . $include_file . ", 'smarty_include_vars' => array(".implode(',', (array)$arg_list)."))";        $output .= "\$this->_smarty_include($_params);\n" .        "\$this->_tpl_vars = \$_smarty_tpl_vars;\n" .        "unset(\$_smarty_tpl_vars);\n";        if (isset($assign_var)) {            $output .= "\$this->assign(" . $assign_var . ", ob_get_contents()); ob_end_clean();\n";        }

⌨️ 快捷键说明

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