discuz mobile 接口加载过程
来源:互联网 发布:手机淘宝为什么登不上 编辑:程序博客网 时间:2024/05/22 15:58
域名/api/mobile/index.php?module=forumdisplay&fid=2
|
index.php 里面判断是否跳check.php或插件下的mobile.php
|
mobile.php 下有一句:require_once 'source/plugin/mobile/mobile.class.php'; 将mobile.class.php导入后执行
以下这段代码来判断要调用哪个接口
if(file_exists($apifile)) {
require_once $apifile;
} else {
if($_GET['version'] > 1) {
for($i = $_GET['version']; $i >= 1; $i--) {
$apifile = 'source/plugin/mobile/api/'.$i.'/'.$_GET['module'].'.php';
if(file_exists($apifile)) {
$_GET['version'] = $i;
require_once $apifile;
break;
} elseif($i==1 && !file_exists($apifile)) {
mobile_core::result(array('error' => 'module_not_exists'));
}
}
} else {
mobile_core::result(array('error' => 'module_not_exists'));
}
}
|
首页帖子则 调用api/1/forumdisplay.php 这个文件 ,而里面包含一句:
include_once 'forum.php';
当这一句被执行后,可以获取的首页帖子数据, 这些数据将放到$_G 缓存里面 ,再通过遍历取出
foreach($_G['forum_threadlist'] as $k => $thread) {
$_G['forum_threadlist'][$k]['cover'] = array();
if($thread['cover']) {
$_img = @getimagesize($thread['coverpath']);
if($_img) {
$_G['forum_threadlist'][$k]['cover'] = array('w' => $_img[0], 'h' => $_img[1]);
}
}
if(!$thread['authorid'] || !$thread['author']) {
$_G['forum_threadlist'][$k]['author'] = $_G['setting']['anonymoustext'];
$_G['forum_threadlist'][$k]['authorid'] = 0;
}
}
0 0
- discuz mobile 接口加载过程
- DISCUZ 之论坛首页加载过程,FORUM相关
- discuz自动加载
- discuz验证过程
- Mobile 输入法接口简介
- Discuz! Passport 接口技术文档
- Discuz! Passport 接口技术文档
- Discuz!登录,注册,退出接口.
- Discuz移动接口原理简介
- WinCE 存储设备驱动加载_接口调用过程
- Windows Mobile 打包过程
- Windows Mobile 打包过程
- Windows Mobile 打包过程
- jquery-mobile过程
- discuz论坛的存储过程
- discuz代码解析-初始化过程
- centos7搭建discuz论坛过程
- Discuz!注册接口.可以不用跳转到Discuz!页面.
- textarea自动变换高度
- Android AdapterView View的复用机制分析
- leetcode.264. Ugly Number II
- AndroidStudio 断开SVN链接
- 判断自守数
- discuz mobile 接口加载过程
- 23种设计模式(3):抽象工厂模式
- iOS开发系列-动画绘图CALayer
- cocoapods管理私有库
- 函数重载总结
- “秒”转换成“时间”
- 【HUSTOJ】1074: 拐角VII
- [NOIP2004]虫食算 T4 简单搜索+剪枝
- row_number() over(partition by '分组' order by '日期')