discuz form.php页面的分析
来源:互联网 发布:淘宝店铺违规了怎么办 编辑:程序博客网 时间:2024/06/06 01:24
这两天需要改动discuz的一点东西,于是看看要改的这里的代码,记录下,方便以后使用
<?php/** * [Discuz!] (C)2001-2099 Comsenz Inc. * This is NOT a freeware, use is subject to license terms * * $Id: forum.php 33828 2013-08-20 02:29:32Z nemohou $ *//*这个函数是从thinkphp赋值的打印数组的*/function dump($var, $echo=true, $label=null, $strict=true) { $label = ($label === null) ? '' : rtrim($label) . ' '; if (!$strict) { if (ini_get('html_errors')) { $output = print_r($var, true); $output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>'; } else { $output = $label . print_r($var, true); } } else { ob_start(); var_dump($var); $output = ob_get_clean(); if (!extension_loaded('xdebug')) { $output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output); $output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>'; } } if ($echo) { echo($output); return null; }else return $output;}define('APPTYPEID', 2);define('CURSCRIPT', 'forum');require './source/class/class_core.php';//定义错误处理机制,自动加载机制等等的机制,实例化一个discuz_application对象赋值给C对象的$_app属性,实例化discuz_application的时候对象的构造函数,调用了几个方法,取出了一系列的参数,get,cookie之类的,并放到了$_G 中,同时把变量地址赋值给了discuz_application->var属性require './source/function/function_forum.php';//载入了各种函数$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'),);$mod = !in_array(C::app()->var['mod'], $modarray) ? 'index' : C::app()->var['mod'];//取出模式变量,在前面已经取出了get参数define('CURMODULE', $mod);//定义了常量,存放模式的值$cachelist = array();if(isset($modcachelist[CURMODULE])) {//查看数组是否存在,这里是存在的 $cachelist = $modcachelist[CURMODULE]; $cachelist[] = 'plugin'; $cachelist[] = 'pluginlanguage_system';//把模式的变量赋值给$cachelist数组并加上了两项}if(C::app()->var['mod'] == 'group') {//这里不等于,不做下面的动作 $_G['basescript'] = 'group';}//var_dump($cachelist);C::app()->cachelist = $cachelist;//把模式的变量,赋值给discuz_application的属性C::app()->init();//实例化数据库对象,设置参数,取出用户信息,session信息等大量的系统需要的数据,(网站菜单栏,全局变量,等等)loadforum();//获取参数,这里是$_GET['fid'](板块id),先获取了板块的内容(板块描述,主题分类等等)的内容set_rssauth();//获取用户的某些信息,这里没有登录,不做研究runhooks();//定义了常量,运行hookscript函数,//hookscript函数,引入了各个插件类,引入各个插件的内容$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['forum']);$_G['setting']['threadhidethreshold'] = 1;require DISCUZ_ROOT.'./source/module/forum/forum_'.$mod.'.php';?>
0 0
- discuz form.php页面的分析
- Discuz的forum_index.php文件的分析
- Discuz注册页面的邮箱验证代码分析
- 【discuz x3】space_notice.php分析
- 一个php页面处理两个form表单的方法
- discuz! 页面含义及目录结构分析
- Discuz代码分析——index.php
- Discuz 7.2 faq.php漏洞分析
- discuz的PHP分页函数
- Discuz! 产品的变量分析
- 怎样将discuz所有页面的Powered by Discuz!去掉
- Discuz!X2.5 在FastCGI模式下php-cgi.exe进程数量增多的原因分析
- php 视图页面form类,非常有用
- php 提交form给本页面
- 【原创】php将form表单多次请求的内容保存到txt并显示到form所在的页面
- 【discuz x3】家园页面产生的动态
- 建立discuz后台管理页面的模板
- 前一个页面的 Form
- 常量指针和指向常量的指针
- 运用onmousewheel事件 写的幻灯片demo
- 在Windows平台上使用Codeblocks开发基于wxWidgets框架应用程序的开发环境准备
- 见证下的自我变化-2014全年总结
- 银光用户界面控件Essential studio for Silverlight功能概述
- discuz form.php页面的分析
- libevent源码阅读笔记——时间管理
- jQuery UI draggable+droppable+resizable+selectable+sortable
- Java笔记----3. 流程控制与数组
- 用求解图内节点是否可达的算法来解决IFDS问题
- 大数据
- leetcode Permutations
- html5tricks.com
- 面向对象第十九课,内部类详解