当前位置: 首页>>代码示例>>PHP>>正文


PHP mobile_core::json方法代码示例

本文整理汇总了PHP中mobile_core::json方法的典型用法代码示例。如果您正苦于以下问题:PHP mobile_core::json方法的具体用法?PHP mobile_core::json怎么用?PHP mobile_core::json使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mobile_core的用法示例。


在下文中一共展示了mobile_core::json方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: build_cache_plugin_mobile

function build_cache_plugin_mobile() {
	if(!defined('DISCUZ_VERSION')) {
	    require './source/discuz_version.php';
	}

	global $_G;

	$setting = array();
	$settings = array('closeforumorderby');
	foreach($settings as $v) {
		$setting[$v] = $_G['setting'][$v];
	}

	if(in_array('mobile', $_G['setting']['plugins']['available'])) {
		$extendsetting = C::t('#mobile#mobile_setting')->fetch_all(array(
			'extend_used',
			'extend_lastupdate'
		));
		$array = array(
			'discuzversion' => DISCUZ_VERSION,
			'charset' => CHARSET,
			'version' => MOBILE_PLUGIN_VERSION,
			'pluginversion' => $_G['setting']['plugins']['version']['mobile'],
			'oemversion' => in_array('mobileoem', $_G['setting']['plugins']['available']) ? $_G['setting']['plugins']['version']['mobileoem'] : '0',
			'regname' => $_G['setting']['regname'],
			'qqconnect' => in_array('qqconnect', $_G['setting']['plugins']['available']) ? '1' : '0',
			'sitename' => $_G['setting']['bbname'],
			'mysiteid' => $_G['setting']['my_siteid'],
			'ucenterurl' => $_G['setting']['ucenterurl'],
			'setting' => $setting,
			'extends' => array('used' => $extendsetting['extend_used'], 'lastupdate' => $extendsetting['extend_lastupdate']),
		);
	} else {
		$array = array();
	}

	require_once './source/plugin/mobile/mobile.class.php';

	$data = array('mobilecheck' => mobile_core::json($array));
	writetocache('mobile', getcachevars($data));
}
开发者ID:hutao1004,项目名称:yintt,代码行数:41,代码来源:cache_mobile.php

示例2: variable

 function variable($variables = array())
 {
     global $_G;
     $globals = array('cookiepre' => $_G['config']['cookie']['cookiepre'], 'auth' => $_G['cookie']['auth'], 'saltkey' => $_G['cookie']['saltkey'], 'member_uid' => $_G['member']['uid'], 'member_username' => $_G['member']['username'], 'groupid' => $_G['groupid'], 'formhash' => FORMHASH, 'ismoderator' => $_G['forum']['ismoderator'], 'readaccess' => $_G['group']['readaccess']);
     if (!empty($_GET['submodule']) == 'checkpost') {
         $apifile = 'source/plugin/mobile/api/' . $_GET['version'] . '/sub_checkpost.php';
         if (file_exists($apifile)) {
             require_once $apifile;
             $globals = $globals + mobile_api_sub::getvariable();
         }
     }
     $xml = array('Version' => '2', 'Charset' => strtoupper($_G['charset']), 'Variables' => array_merge($globals, $variables));
     if (!empty($_G['messageparam'])) {
         $message_result = lang('plugin/mobile', $_G['messageparam'][0], $_G['messageparam'][2]);
         if ($message_result == $_G['messageparam'][0]) {
             $vars = explode(':', $_G['messageparam'][0]);
             if (count($vars) == 2) {
                 $message_result = lang('plugin/' . $vars[0], $vars[1], $_G['messageparam'][2]);
                 $_G['messageparam'][0] = $vars[1];
             } else {
                 $message_result = lang('message', $_G['messageparam'][0], $_G['messageparam'][2]);
             }
         }
         $message_result = strip_tags($message_result);
         if ($_G['messageparam'][4]) {
             $_G['messageparam'][0] = "custom";
         }
         if ($_G['messageparam'][3]['login'] && !$_G['uid']) {
             $_G['messageparam'][0] .= '//' . $_G['messageparam'][3]['login'];
         }
         $xml['Message'] = array("messageval" => $_G['messageparam'][0], "messagestr" => $message_result);
         if ($_GET['mobilemessage']) {
             $return = mobile_core::json($xml);
             header("HTTP/1.1 301 Moved Permanently");
             header("Location:discuz://" . $_G['messageparam'][0] . "//" . rawurlencode(diconv($message_result, $_G['charset'], "utf-8")) . ($return ? "//" . rawurlencode($return) : ''));
             exit;
         }
     }
     return $xml;
 }
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:40,代码来源:mobile.class.php

示例3: exit

 */
if (!defined('IN_MOBILE_API')) {
    exit('Access Denied');
}
require './source/class/class_core.php';
$discuz = C::app();
$discuz->init();
if (!defined('DISCUZ_VERSION')) {
    require './source/discuz_version.php';
}
if (in_array('mobile', $_G['setting']['plugins']['available'])) {
    loadcache('wsq_checkinfo');
    if (!$_G['cache']['wsq_checkinfo'] || TIMESTAMP - $_G['cache']['wsq_checkinfo']['expiration'] > 600) {
        $_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
        $forums = C::t('forum_forum')->fetch_all_by_status(1);
        foreach ($forums as $forum) {
            $posts += $forum['posts'];
        }
        loadcache('userstats');
        $array = array('discuzversion' => DISCUZ_VERSION, 'charset' => CHARSET, 'version' => MOBILE_PLUGIN_VERSION, 'pluginversion' => $_G['setting']['plugins']['version']['mobile'], 'regname' => $_G['setting']['regname'], 'qqconnect' => in_array('qqconnect', $_G['setting']['plugins']['available']) ? '1' : '0', 'wsqqqconnect' => in_array('qqconnect', $_G['setting']['plugins']['available']) ? '1' : '0', 'wsqhideregister' => $_G['wechat']['setting']['wechat_allowregister'] && $_G['wechat']['setting']['wechat_allowfastregister'] ? '1' : '0', 'sitename' => $_G['setting']['bbname'], 'mysiteid' => $_G['setting']['my_siteid'], 'ucenterurl' => $_G['setting']['ucenterurl'], 'defaultfid' => $_G['wechat']['setting']['wsq_fid'], 'totalposts' => $posts, 'totalmembers' => $_G['cache']['userstats']['totalmembers']);
        savecache('wsq_checkinfo', array('variable' => $array, 'expiration' => TIMESTAMP));
    } else {
        $array = $_G['cache']['wsq_checkinfo']['variable'];
    }
} else {
    $array = array();
}
$array['testcookie'] = $_G['cookie']['testcookie'];
$data = mobile_core::json($array);
mobile_core::make_cors($_SERVER['REQUEST_METHOD'], REQUEST_METHOD_DOMAIN);
echo $data;
开发者ID:samyex6,项目名称:discuz3.2-lite,代码行数:31,代码来源:check.php

示例4: variable

 function variable($variables = array())
 {
     global $_G;
     if (in_array('mobileoem', $_G['setting']['plugins']['available'])) {
         $check = C::t('#mobileoem#mobileoem_member')->fetch($_G['uid']);
     }
     $globals = array('cookiepre' => $_G['config']['cookie']['cookiepre'], 'auth' => $_G['cookie']['auth'], 'saltkey' => $_G['cookie']['saltkey'], 'member_uid' => $_G['member']['uid'], 'member_username' => $_G['member']['username'], 'groupid' => $_G['groupid'], 'formhash' => FORMHASH, 'ismoderator' => $_G['forum']['ismoderator'], 'readaccess' => $_G['group']['readaccess'], 'notice' => array('newpush' => $check['newpush'] ? 1 : 0, 'newpm' => dintval($_G['member']['newpm']), 'newprompt' => dintval($_G['member']['newprompt'] - $_G['member']['category_num']['mypost'] >= 0 ? $_G['member']['newprompt'] - $_G['member']['category_num']['mypost'] : 0), 'newmypost' => dintval($_G['member']['category_num']['mypost'])));
     if (!empty($_GET['submodule']) == 'checkpost') {
         $apifile = 'source/plugin/mobile/api/' . $_GET['version'] . '/sub_checkpost.php';
         if (file_exists($apifile)) {
             require_once $apifile;
             $globals = $globals + mobile_api_sub::getvariable();
         }
     }
     $xml = array('Version' => $_GET['version'], 'Charset' => strtoupper($_G['charset']), 'Variables' => array_merge($globals, $variables));
     if (!empty($_G['messageparam'])) {
         $message_result = lang('plugin/mobile', $_G['messageparam'][0], $_G['messageparam'][2]);
         if ($message_result == $_G['messageparam'][0]) {
             $vars = explode(':', $_G['messageparam'][0]);
             if (count($vars) == 2) {
                 $message_result = lang('plugin/' . $vars[0], $vars[1], $_G['messageparam'][2]);
                 $_G['messageparam'][0] = $vars[1];
             } else {
                 $message_result = lang('message', $_G['messageparam'][0], $_G['messageparam'][2]);
             }
         }
         $message_result = strip_tags($message_result);
         if (defined('IS_WEBVIEW') && IS_WEBVIEW && in_array('mobileoem', $_G['setting']['plugins']['available'])) {
             include_once DISCUZ_ROOT . './source/plugin/mobileoem/discuzcode.func.php';
             include mobileoem_template('common/showmessage');
             if (!empty($_GET['debug'])) {
                 exit;
             }
             $content = ob_get_contents();
             ob_end_clean();
             $xml['Variables']['datatype'] = -1;
             $xml['Variables']['webview_page'] = $content;
             return $xml;
         }
         if ($_G['messageparam'][4]) {
             $_G['messageparam'][0] = "custom";
         }
         if ($_G['messageparam'][3]['login'] && !$_G['uid']) {
             $_G['messageparam'][0] .= '//' . $_G['messageparam'][3]['login'];
         }
         $xml['Message'] = array("messageval" => $_G['messageparam'][0], "messagestr" => $message_result);
         if ($_GET['mobilemessage']) {
             $return = mobile_core::json($xml);
             header("HTTP/1.1 301 Moved Permanently");
             header("Location:discuz://" . rawurlencode($_G['messageparam'][0]) . "//" . rawurlencode(diconv($message_result, $_G['charset'], "utf-8")) . ($return ? "//" . rawurlencode($return) : ''));
             exit;
         }
     }
     return $xml;
 }
开发者ID:MCHacker,项目名称:docker-discuz,代码行数:55,代码来源:mobile.class.php

示例5: exit

<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: check.php 32817 2013-03-13 11:29:12Z monkey $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if (!defined('DISCUZ_VERSION')) {
    require './source/discuz_version.php';
}
global $_G;
$setting = array();
$settings = array('closeforumorderby');
foreach ($settings as $v) {
    $setting[$v] = $_G['setting'][$v];
}
if (in_array('mobile', $_G['setting']['plugins']['available'])) {
    $extendsetting = C::t('#mobile#mobile_setting')->fetch_all(array('extend_used', 'extend_lastupdate'));
    $array = array('discuzversion' => DISCUZ_VERSION, 'charset' => CHARSET, 'version' => MOBILE_PLUGIN_VERSION, 'pluginversion' => $_G['setting']['plugins']['version']['mobile'], 'regname' => $_G['setting']['regname'], 'qqconnect' => in_array('qqconnect', $_G['setting']['plugins']['available']) ? '1' : '0', 'sitename' => $_G['setting']['bbname'], 'mysiteid' => $_G['setting']['my_siteid'], 'ucenterurl' => $_G['setting']['ucenterurl'], 'setting' => $setting, 'extends' => array('used' => $extendsetting['extend_used'], 'lastupdate' => $extendsetting['extend_lastupdate']));
} else {
    $array = array();
}
require_once './source/plugin/mobile/mobile.class.php';
$data = array('mobilecheck' => mobile_core::json($array));
writetocache('mobile', getcachevars($data));
开发者ID:wait121000,项目名称:discuz3.0forsae,代码行数:29,代码来源:cache_mobile.php


注:本文中的mobile_core::json方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。