修复 细节微社区在PHP7.1的兼容问题
This commit is contained in:
parent
c25e4ae81e
commit
fea2961990
upload/source/plugin/mobile
|
@ -4,7 +4,7 @@
|
||||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||||
* This is NOT a freeware, use is subject to license terms
|
* This is NOT a freeware, use is subject to license terms
|
||||||
*
|
*
|
||||||
* $Id: check.php 35031 2014-10-23 08:11:31Z nemohou $
|
* $Id: check.php 36332 2016-12-30 01:44:19Z nemohou $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!defined('IN_MOBILE_API')) {
|
if(!defined('IN_MOBILE_API')) {
|
||||||
|
@ -30,7 +30,7 @@ if(in_array('mobile', $_G['setting']['plugins']['available'])) {
|
||||||
}
|
}
|
||||||
loadcache('userstats');
|
loadcache('userstats');
|
||||||
$array = array(
|
$array = array(
|
||||||
'discuzversion' => DISCUZ_VERSION,
|
'discuzversion' => 'X3.2',
|
||||||
'charset' => CHARSET,
|
'charset' => CHARSET,
|
||||||
'version' => MOBILE_PLUGIN_VERSION,
|
'version' => MOBILE_PLUGIN_VERSION,
|
||||||
'pluginversion' => $_G['setting']['plugins']['version']['mobile'],
|
'pluginversion' => $_G['setting']['plugins']['version']['mobile'],
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||||
* This is NOT a freeware, use is subject to license terms
|
* This is NOT a freeware, use is subject to license terms
|
||||||
*
|
*
|
||||||
* $Id: mobile.class.php 36278 2016-12-09 07:52:35Z nemohou $
|
* $Id: mobile.class.php 36332 2016-12-30 01:44:19Z nemohou $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define("MOBILE_PLUGIN_VERSION", "4");
|
define("MOBILE_PLUGIN_VERSION", "4");
|
||||||
|
@ -12,7 +12,7 @@ define("REQUEST_METHOD_DOMAIN", 'http://wsq.discuz.com');
|
||||||
|
|
||||||
class mobile_core {
|
class mobile_core {
|
||||||
|
|
||||||
function result($result) {
|
static function result($result) {
|
||||||
global $_G;
|
global $_G;
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
|
function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
|
||||||
|
@ -27,7 +27,7 @@ class mobile_core {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
function format($result) {
|
static function format($result) {
|
||||||
switch (gettype($result)) {
|
switch (gettype($result)) {
|
||||||
case 'array':
|
case 'array':
|
||||||
foreach($result as $_k => $_v) {
|
foreach($result as $_k => $_v) {
|
||||||
|
@ -44,7 +44,7 @@ class mobile_core {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function json($encode) {
|
static function json($encode) {
|
||||||
if(!empty($_GET['debug']) && defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) {
|
if(!empty($_GET['debug']) && defined('DISCUZ_DEBUG') && DISCUZ_DEBUG) {
|
||||||
return debug($encode);
|
return debug($encode);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class mobile_core {
|
||||||
return CJSON::encode($encode);
|
return CJSON::encode($encode);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getvalues($variables, $keys, $subkeys = array()) {
|
static function getvalues($variables, $keys, $subkeys = array()) {
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach($variables as $key => $value) {
|
foreach($variables as $key => $value) {
|
||||||
foreach($keys as $k) {
|
foreach($keys as $k) {
|
||||||
|
@ -70,14 +70,14 @@ class mobile_core {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function arraystring($array) {
|
static function arraystring($array) {
|
||||||
foreach($array as $k => $v) {
|
foreach($array as $k => $v) {
|
||||||
$array[$k] = is_array($v) ? mobile_core::arraystring($v) : (string)$v;
|
$array[$k] = is_array($v) ? mobile_core::arraystring($v) : (string)$v;
|
||||||
}
|
}
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
function variable($variables = array()) {
|
static function variable($variables = array()) {
|
||||||
global $_G;
|
global $_G;
|
||||||
if(in_array('mobileoem', $_G['setting']['plugins']['available'])) {
|
if(in_array('mobileoem', $_G['setting']['plugins']['available'])) {
|
||||||
$check = C::t('#mobileoem#mobileoem_member')->fetch($_G['uid']);
|
$check = C::t('#mobileoem#mobileoem_member')->fetch($_G['uid']);
|
||||||
|
@ -172,7 +172,7 @@ class mobile_core {
|
||||||
return $xml;
|
return $xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
function diconv_array($variables, $in_charset, $out_charset) {
|
static function diconv_array($variables, $in_charset, $out_charset) {
|
||||||
foreach($variables as $_k => $_v) {
|
foreach($variables as $_k => $_v) {
|
||||||
if(is_array($_v)) {
|
if(is_array($_v)) {
|
||||||
$variables[$_k] = mobile_core::diconv_array($_v, $in_charset, $out_charset);
|
$variables[$_k] = mobile_core::diconv_array($_v, $in_charset, $out_charset);
|
||||||
|
@ -183,7 +183,7 @@ class mobile_core {
|
||||||
return $variables;
|
return $variables;
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_cors($request_method, $origin = '') {
|
static function make_cors($request_method, $origin = '') {
|
||||||
|
|
||||||
$origin = $origin ? $origin : REQUEST_METHOD_DOMAIN;
|
$origin = $origin ? $origin : REQUEST_METHOD_DOMAIN;
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ class mobile_core {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function usergroupIconId($groupid) {
|
static function usergroupIconId($groupid) {
|
||||||
global $_G;
|
global $_G;
|
||||||
if($_G['cache']['usergroupIconId']) {
|
if($_G['cache']['usergroupIconId']) {
|
||||||
return $_G['cache']['usergroupIconId']['variable'][$groupid];
|
return $_G['cache']['usergroupIconId']['variable'][$groupid];
|
||||||
|
@ -249,7 +249,7 @@ class mobile_core {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function activeHook($module, $mobileapihook, &$param, $isavariables = false) {
|
static function activeHook($module, $mobileapihook, &$param, $isavariables = false) {
|
||||||
global $_G;
|
global $_G;
|
||||||
if($isavariables) {
|
if($isavariables) {
|
||||||
$mobileapihook[$module] = array(
|
$mobileapihook[$module] = array(
|
||||||
|
|
Loading…
Reference in New Issue