function afterUpdate()
 {
     areaEot('main');
     //实时更新模板
 }
Пример #2
0
/**
 * 获取模式下的模板文件路径
 *
 * @global string $db_mode
 * @global string $db_tplpath
 * @param string $template 模板名
 * @param string $ext 扩展名
 * @return string
 */
function modeEot($template, $EXT = 'htm')
{
    global $db_mode;
    if ($db_mode == 'area') {
        return areaEot($template, $EXT);
    } else {
        $srcTpl = M_P . "template/{$template}.{$EXT}";
        $tarTpl = D_P . "data/tplcache/" . $db_mode . '_' . $template . '.' . $EXT;
    }
    if (!file_exists($srcTpl)) {
        return false;
    }
    if (pwFilemtime($tarTpl) > pwFilemtime($srcTpl)) {
        return $tarTpl;
    } else {
        return modeTemplate($srcTpl, $tarTpl);
    }
}