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


PHP mobile_core::activeHook方法代码示例

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


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

示例1: 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'], 'member_avatar' => avatar($_G['member']['uid'], 'small', true), '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();
         }
     }
     $pluginvariables = array();
     if (!empty($_G['setting']['mobileapihook'])) {
         $mobileapihook = unserialize($_G['setting']['mobileapihook']);
         if (!empty($mobileapihook[$_GET['module']])) {
             if (!empty($mobileapihook[$_GET['module']]['variables'])) {
                 mobile_core::activeHook($_GET['module'], $mobileapihook, $variables, true);
                 unset($mobileapihook[$_GET['module']]['variables']);
             }
             if (!empty($mobileapihook[$_GET['module']])) {
                 $param = array();
                 $pluginvariables = mobile_core::activeHook($_GET['module'], $mobileapihook, $param);
             }
         }
     }
     $xml = array('Version' => $_GET['version'], 'Charset' => strtoupper($_G['charset']), 'Variables' => array_merge($globals, $variables));
     if ($pluginvariables) {
         $xml['pluginVariables'] = $pluginvariables;
     }
     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:samyex6,项目名称:discuz3.2-lite,代码行数:72,代码来源:mobile.class.php


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