diff --git a/upload/source/class/discuz/discuz_application.php b/upload/source/class/discuz/discuz_application.php index ad6917e..9f43b52 100644 --- a/upload/source/class/discuz/discuz_application.php +++ b/upload/source/class/discuz/discuz_application.php @@ -734,6 +734,9 @@ class discuz_application extends discuz_base{ $unallowmobile = true; } + if(getgpc('forcemobile')) { + dsetcookie('dismobilemessage', '1', 3600); + } $mobile = getgpc('mobile'); $mobileflag = isset($this->var['mobiletpl'][$mobile]); diff --git a/upload/source/class/helper/helper_mobile.php b/upload/source/class/helper/helper_mobile.php index 4dedeac..558ef4c 100644 --- a/upload/source/class/helper/helper_mobile.php +++ b/upload/source/class/helper/helper_mobile.php @@ -39,11 +39,10 @@ class helper_mobile { ob_start(); $_G['forcemobilemessage'] = true; parse_str($_SERVER['QUERY_STRING'], $query); - $query['mobile'] = 'no'; + $query['forcemobile'] = '1'; $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); - dsetcookie('dismobilemessage', '1', 3600); showmessage('not_in_mobile'); exit; } diff --git a/upload/source/function/function_core.php b/upload/source/function/function_core.php index c71d6b7..f06aed1 100644 --- a/upload/source/function/function_core.php +++ b/upload/source/function/function_core.php @@ -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'))) { $tplfile = $mobiletplfile; } 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']) { $tplfile = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $tplfile); $file = str_replace($_G['mobiletpl'][IN_MOBILE].'/', '', $file);