./upload/forum.php
这是forum.php的全部代码,然后试着读一读,自己做做笔记。
define('APPTYPEID', 2);
define('CURSCRIPT', 'forum');
define(); 定义常量的函数,结果为 apptypeid = 2, curscript = 'forum'。
为何这么设定,还不知道。
require './source/class/class_core.php';
require './source/function/function_forum.php';
导入2个文件
class_core.php - 论坛的主要类文件,core类和c类,都是在这个文件中定义的
function_forum.php - 论坛forum模块使用的函数,都放在这个文件中。
$modarray = array('ajax','announcement','attachment','forumdisplay',
'group','image','index','medal','misc','modcp','notice','post','redirect',
'relatekw','relatethread','rss','topicadmin','trade','viewthread','tag','collection','guide'
);
$modcachelist = array(
'index' => array('announcements', 'onlinelist', 'forumlinks',
'heats', 'historyposts', 'onlinerecord', 'userstats', 'diytemplatenameforum'),
'forumdisplay' => array('smilies', 'announcements_forum', 'globalstick', 'forums',
'onlinelist', 'forumstick', 'threadtable_info', 'threadtableids', 'stamps', 'diytemplatenameforum'),
'viewthread' => array('smilies', 'smileytypes', 'forums', 'usergroups',
'stamps', 'bbcodes', 'smilies', 'custominfo', 'groupicon', 'stamps',
'threadtableids', 'threadtable_info', 'posttable_info', 'diytemplatenameforum'),
'redirect' => array('threadtableids', 'threadtable_info', 'posttable_info'),
'post' => array('bbcodes_display', 'bbcodes', 'smileycodes', 'smilies', 'smileytypes',
'domainwhitelist', 'albumcategory'),
'space' => array('fields_required', 'fields_optional', 'custominfo'),
'group' => array('grouptype', 'diytemplatenamegroup'),
);
定义了2个变量
$modarray 模型的种类, 'ajax','announcement','attachment'...
$modcachelist 模型的缓存列表 index 包含'announcements', 'onlinelist', 'forumlinks' //还不太理解为何这样。
$mod = !in_array(C::app()->var['mod'], $modarray) ? 'index' : C::app()->var['mod'];
语法没问题, in_arrary(), $mod为 首页,index, 否则 模块为 。
$mod = !in_array(C::app()->var['mod'], $modarray) ? 'index' : C::app()->var['mod'];
define('CURMODULE', $mod);
$cachelist = array();
if(isset($modcachelist[CURMODULE])) {
$cachelist = $modcachelist[CURMODULE];
$cachelist[] = 'plugin';
$cachelist[] = 'pluginlanguage_system';
}
if(C::app()->var['mod'] == 'group') {
$_G['basescript'] = 'group';
}
C::app()->cachelist = $cachelist;
C::app()->init();
loadforum();
set_rssauth();
runhooks();
$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['forum']);
$_G['setting']['threadhidethreshold'] = 1;
require DISCUZ_ROOT.'./source/module/forum/forum_'.$mod.'.php';
./upload/forum.php的更多相关文章
- ./upload/source/class/class_core.php
定义了core这个类 error_reporting(E_ALL); error_reporting() 设置 PHP 的报错级别并返回当前级别.可以参考手册. define('IN_DISCUZ', ...
- Asp.net MVC 中Ajax的使用 [分享]
文章转自 http://www.huiyoumi.wang/upload/forum.php?mod=viewthread&tid=75&extra= Asp.net MVC 抛弃了A ...
- LoadRunner测试下载功能点脚本(方法二)
在上一篇<LoadRunner下载功能点脚本(方法一)>中,实现的脚本仅是录制下载功能点的脚本,现在性能需求的场景更改如下: 性能需求:对系统某页面中,点击下载并将下载文件保存到本地电脑的 ...
- LoadRunner测试下载功能点脚本(方法一)
性能需求:对系统某页面中,点击下载功能做并发测试,以获取在并发下载文件的情况下系统的性能指标. 备注:页面上点击下载时的文件可以是word.excel.pdf等. 问题1:录制完下载的场景后,发现脚本 ...
- LR实战之Discuz开源论坛——登录脚本检查点
在开发Discuz登录脚本时,遇到的一个问题是怎么去验证虚拟用户真正的登录成功,当然,熟悉LoadRunner工具的人就会知道,在脚本中使用检查点,对,没错! 我们知道,LR检查点功能有两种:文本检查 ...
- LR实战之Discuz开源论坛——登录脚本
脚本业务流:访问Discuz论坛首页——登录论坛——退出论坛.本次使用LoadRunner11版本. 一.录制脚本注意 1.确保Discuz论坛能在服务器运行正常. 2.录制前先试访问Discuz论坛 ...
- LR实战之Discuz开源论坛——安装及简介
想了很久,也许是因为这段时间特别闲,从毕业到现在,我的测试职业生涯也近两年了,发现自己越来越喜欢测试领域,也越来越偏向测试开发了,作为一名专业的测试人员,不得不要学习性能测试,而使用LoadRunne ...
- 【思路解析】discuz 帖子设置封面 setthreadcover 表pre_forum_threadimage
在Discuz 中有一项就是给帖子设置封面,很多情况下只能通过手动的方式去设置或者用提交POST请求的式去设置: 但是这都是调用DISCUZ的功能设置的: 有的时候并非万能的,也有用不到的时候:下面就 ...
- 【C#点滴记录】ASP.NET 使用C# 导出Word 和Excel
原文摘自 慧优米网,链接地址:http://huiyoumi.wang/upload/forum.php?mod=viewthread&tid=797&extra= 好了正文来了 今天 ...
随机推荐
- centos 安装beanstalkd
You need to have the EPEL repo (http://www.servermom.org/2-cents-tip-how-to-enable-epel-repo-on-cent ...
- jquery/js分割数组
substr(star[,length]);//star起始位置 length截取的长度 substring(star,end);//star起始位置,end结束位置 都是以0开始的索引值
- Ionic2学习笔记
Component nav: <ion-nav [root] = 'rootComponent'></ion-nav> ....import {Nav} from 'ionic ...
- 【PKU1001】Exponentiation(高精度乘法)
Exponentiation Time Limit: 500MS Memory Limit: 10000K Total Submissions: 145642 Accepted: 35529 ...
- VS2008基于对话框的MFC上位机串口通信(C++实现)简单例程
首先,在 vs2008 环境下创建 MFC 运用程序 设置项目名称为 ComTest(这个地方随意命名,根据个人习惯),点击确定后,点击下一步 出现如下界面 选择"基于对话框"模式 ...
- 基于CWMP(TR069)协议ACS服务器的搭建
Linux上安装openacs Openacs的安装分为四大步: 1.安装jdk 2.安装jboss 3.安装mysql 4.部署openacs JDK简介 Java DevelopmentKit(J ...
- asp.net 各种路径
Request.Path 是包含文件名的,而 Request.ApplicationPath 是应用程序路径,不包含文件名. 示例: Request.Path = /cftea/Default.asp ...
- Linux LVM硬盘管理之二:创建逻辑卷步骤
创建逻辑卷(LV)的顺序:Linux分区---物理卷(PV)---卷组(VG)---逻辑卷(LV)---挂载到文件系统 删除逻辑卷(LV)的顺序:卸载文件系统----逻辑卷(LV)---卷组(VG)- ...
- elasticsearch【cat API,系统数据】指令汇总
本博文讲述的ES获取系统数据的API是基于Elasticsearch 2.4.1版本的. 0. overview a. 下面将要介绍的所有的指令,都支持一个查询参数v(verbose),用来显示详细的 ...
- Verilog HDL那些事_建模篇笔记(实验三:按键消抖)
实验三:按键消抖 首先将按键消抖功能分成了两个模块,电平检查模块和10ms延迟模块.电平检测模块用来检测按键信号的变化(是否被按下),10ms延迟模块用来稳定电平检查模块的输入,进而稳定按键信号,防止 ...