增加 新触屏版入口

This commit is contained in:
Comsenz 2017-09-30 09:26:13 +08:00
parent 7d603a197c
commit f7e84763fd
1 changed files with 71 additions and 0 deletions

71
upload/m/index.php Normal file
View File

@ -0,0 +1,71 @@
<?php
define('IN_MOBILE', 4);
define('IN_NEWMOBILE', true);
global $_G;
chdir('../');
require './source/class/class_core.php';
$discuz = C::app();
$discuz->reject_robot();
$discuz->init_cron = false;
$discuz->init_session = false;
$discuz->init_user = false;
$discuz->init_mobile = false;
$discuz->init();
if ($_GET['c'] == 'static') {
$path = DISCUZ_ROOT . $_G['style']['tpldir'] . '/m/js/';
$bpath = DISCUZ_ROOT . 'template/default/m/js/';
header("Content-type: application/json");
$files = explode(',', $_GET['f']);
$version = $_GET['v'];
$cachename = 'static_' . md5($_GET['f']) . $version;
if (!$files) {
$array = array('code' => 1);
echo json_encode($array);
exit;
}
$contents = array();
foreach ($files as $file) {
if (strpos($file, '..') !== false) {
continue;
}
$filename = file_exists($path . $file) ? $path . $file : $bpath . $file;
$contents[$file] = file_get_contents($filename);
}
$array = array('code' => 0, 'file' => $contents);
$result = json_encode($array);
echo $result;
exit;
}
$jsglobal = array(
'source' => '',
'cookiepre' => $discuz->config['cookie']['cookiepre'],
'jsversion' => !$discuz->config['debug'] ? $_G['style']['verhash'] : time(),
'f' => '',
'path' => '',
'formhash' => FORMHASH,
'plugins' => array()
);
$site = array(
'siteId' => 0,
'siteUrl' => $_G['siteurl'],
'siteName' => diconv($_G['setting']['sitename'], CHARSET, 'UTF-8'),
'siteLogo' => $_G['siteurl'] . '/static/image/common/logom.png',
'openApi' => array(),
);
if (!$_G['setting']['mobile']['allowmnew']) {
dheader('location: ' . $_G['siteurl']);
}
$a = $_GET['a'] && preg_match('/^\w+$/', $_GET['a']) ? $_GET['a'] : 'forumlist';
include template('m/' . $a);