destoon禁用手机模板
include/global.fun.php
function template($template = ‘index’, $dir = ”) {
global $CFG, $DT_PC;
$DT_PC = 1; //强制设为pc模式
check_name($template) or exit(‘BAD TPL NAME’);
if($dir) check_name($dir) or exit(‘BAD TPL DIR’);
$tpl = $DT_PC ? $CFG[‘template’] : $CFG[‘template_mobile’];
$to = DT_CACHE.’/tpl/’.$tpl.’/’.($dir ? $dir.’/’ : ”).$template.’.php’;
$isfileto = is_file($to);
if($CFG[‘template_refresh’] || !$isfileto) {
if($dir) $dir = $dir.’/’;
$from = DT_ROOT.’/template/’.$tpl.’/’.$dir.$template.’.htm’;
if(!is_file($from)) $from = DT_ROOT.’/template/’.($DT_PC ? ‘default’ : ‘mobile’).’/’.$dir.$template.’.htm’;
if(!$isfileto || filemtime($from) > filemtime($to) || (filesize($to) == 0 && filesize($from) > 0)) {
require_once DT_ROOT.’/include/template.func.php’;
template_compile($from, $to);
}
}
return $to;
}
include/mobile.inc.php
defined(‘IN_DESTOON’) or exit(‘Access Denied’);
require DT_ROOT.’/include/mobile.func.php’;
if(is_pc() && strpos($DT_URL, ‘device.php’) === false)
//dheader(DT_PATH.’api/mobile.php?action=device&uri=’.urlencode($head_pc)); //这一句注释掉
include load(‘mobile.lang’);

未经允许不得转载:跨屏互联 » destoon禁用手机模板