/source/function_common.php中的代码

//模板调用
function template($name) {
    global $_SCONFIG, $_SGLOBAL;

    if($_SGLOBAL['mobile']) {
        $objfile = S_ROOT.'./api/mobile/tpl_'.$name.'.php';
        if (!file_exists($objfile)) {
            showmessage('m_function_is_disable_on_wap');
        }
    } else {
        if(strexists($name,'/')) {
            $tpl = $name;
        } else {
            $tpl = "template/$_SCONFIG[template]/$name";
        }
        $objfile = S_ROOT.'./data/tpl_cache/'.str_replace('/','_',$tpl).'.php';
        //修改后的内容,实现缓存自动更新!
        if(!file_exists($objfile) || @filemtime($tpl.".htm") > @filemtime($objfile)) {
             include_once(S_ROOT.'./source/function_template.php');
             parse_template($tpl);
        }
    }
    return $objfile;
}

 

 

相关文章:

  • 2021-06-01
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-06-11
  • 2022-12-23
  • 2021-12-22
猜你喜欢
  • 2021-07-09
  • 2022-02-16
  • 2021-05-24
  • 2022-02-07
  • 2022-12-23
  • 2022-01-22
相关资源
相似解决方案