修复 手机和PC切换的细节 BUG
This commit is contained in:
parent
ce6e273c74
commit
79c9a87183
|
@ -734,6 +734,9 @@ class discuz_application extends discuz_base{
|
||||||
$unallowmobile = true;
|
$unallowmobile = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(getgpc('forcemobile')) {
|
||||||
|
dsetcookie('dismobilemessage', '1', 3600);
|
||||||
|
}
|
||||||
|
|
||||||
$mobile = getgpc('mobile');
|
$mobile = getgpc('mobile');
|
||||||
$mobileflag = isset($this->var['mobiletpl'][$mobile]);
|
$mobileflag = isset($this->var['mobiletpl'][$mobile]);
|
||||||
|
|
|
@ -39,11 +39,10 @@ class helper_mobile {
|
||||||
ob_start();
|
ob_start();
|
||||||
$_G['forcemobilemessage'] = true;
|
$_G['forcemobilemessage'] = true;
|
||||||
parse_str($_SERVER['QUERY_STRING'], $query);
|
parse_str($_SERVER['QUERY_STRING'], $query);
|
||||||
$query['mobile'] = 'no';
|
$query['forcemobile'] = '1';
|
||||||
$query_sting_tmp = http_build_query($query);
|
$query_sting_tmp = http_build_query($query);
|
||||||
$_G['setting']['mobile']['pageurl'] = $_G['siteurl'].substr($_G['PHP_SELF'], 1).'?'.$query_sting_tmp;
|
$_G['setting']['mobile']['pageurl'] = $_G['siteurl'].basename($_G['PHP_SELF']).'?'.$query_sting_tmp;
|
||||||
unset($query_sting_tmp);
|
unset($query_sting_tmp);
|
||||||
dsetcookie('dismobilemessage', '1', 3600);
|
|
||||||
showmessage('not_in_mobile');
|
showmessage('not_in_mobile');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -623,7 +623,7 @@ function template($file, $templateid = 0, $tpldir = '', $gettplfile = 0, $primal
|
||||||
if(strpos($tpldir, 'plugin') && (file_exists(DISCUZ_ROOT.$mobiletplfile) || file_exists(substr(DISCUZ_ROOT.$mobiletplfile, 0, -4).'.php'))) {
|
if(strpos($tpldir, 'plugin') && (file_exists(DISCUZ_ROOT.$mobiletplfile) || file_exists(substr(DISCUZ_ROOT.$mobiletplfile, 0, -4).'.php'))) {
|
||||||
$tplfile = $mobiletplfile;
|
$tplfile = $mobiletplfile;
|
||||||
} elseif(!file_exists(DISCUZ_ROOT.TPLDIR.'/'.$mobiletplfile) && !file_exists(substr(DISCUZ_ROOT.TPLDIR.'/'.$mobiletplfile, 0, -4).'.php')) {
|
} elseif(!file_exists(DISCUZ_ROOT.TPLDIR.'/'.$mobiletplfile) && !file_exists(substr(DISCUZ_ROOT.TPLDIR.'/'.$mobiletplfile, 0, -4).'.php')) {
|
||||||
$mobiletplfile = './template/default/'.$mobiletplfile;
|
$mobiletplfile = './template/default/'.$file.'.htm';
|
||||||
if(!file_exists(DISCUZ_ROOT.$mobiletplfile) && !$_G['forcemobilemessage']) {
|
if(!file_exists(DISCUZ_ROOT.$mobiletplfile) && !$_G['forcemobilemessage']) {
|
||||||
$tplfile = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $tplfile);
|
$tplfile = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $tplfile);
|
||||||
$file = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $file);
|
$file = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $file);
|
||||||
|
|
Loading…
Reference in New Issue