First, the basic structure of the entire site:
1, first, the introduction of the site's main three folders: Root\source\, root\template\, root\static\, respectively, is the Code folder, template folder, static folder (JS, CSS, image, etc.).
2. Secondly, introduce some basic control files.
Entry file [Root\xxx. PHP], including forum.php, portal.php, home.php, and so on, the role is to control the page of the steering, each portal file contains the kernel (Core_class), Method (FUNCTION_XXX), modules (module) Three of the most important parts. The workflow of the file is to first refer to the kernel file for initialization, then refer to the method file declaration and definition of the function that needs to be called, and finally execute the related function in the module file, and the whole portal file is only to distinguish the entrance, introduce the relative entrance of the required files, and according to the submitted $_get[' MoD '] To determine which module to turn to, the part that actually executes the code is in the module file.
Method file [root\source\function\function_xxx.php], the file that defines and declares the function method. The file is all function, so nothing happens when the file executes, because nothing is executed.
The module file [root\source\module\xxx\ccc.php], the calling method and the file where the logical statement is executed, is selected by the $_get[' mod '), and the static template is called after execution, so that the static template can be directly taken to the program execution is the resulting data.
template file [root\template\xxx\ccc.htm], called by the module file, you can execute some PHP statements to output data.
Kernel file [root\source\class\*.php], some kernel code of the system, wherein the core_class.php includes the initialization function, you can add some initialization code and global data.
3, there are some of the more special folders, such as [root\template\common\] in the file, some are common, such as head, foot, common.css and so on.
Ii. how the website works
First, let's take a look at the URL address:
http://localhost/forum.php?mod=forumdisplay&fid=38
From this URL we can get some information: entry file forum.php,mod=forumdisplay,fid=38
Next, the program goes through the route is to first enter the forum.php code snippet, open the file, the first two sentences introduced:
Require './source/class/class_core.php ';
Require './source/function/function_forum.php ';
One is the kernel, one is the method function. And then looking down, there's an assignment statement.
$mod =!in_array ($discuz->var[' mod '), $modarray)? ' Index ': $discuz->var[' mod '];
The function of this sentence is to determine whether the transferred MoD value is valid, effective, the introduction of effective modules, if not valid to introduce the default index module.
The last is the reference module require discuz_root. /source/module/forum/forum_ '. $mod. PHP ';
Open source/module/forum/forum_forumdisplay.php, which is the code to get the data. One of them started with
$_g[' action ' [' fid '] = $_g[' fid ']; One sentence, that is, the FID is acquired here. Here's how to get data and stuff like that I'm not going to explain this, it's basically calling functions inside the function, and then there's a return value ... Let's go straight to the end
if (!defined (' In_archiver ')) {
Include template ($template);
} else {
Include Loadarchiver (' Forum/forumdisplay ');
}
OK, call the template file here, and the data will be output on the template file.
Iii. some places to be aware of
Template files using tags to replace the PHP statement, detailed information please check the official relevant documents (or casually open a template, there are all the tags, according to gourd), can not use the label, you may try {eval PHP statement} to execute.
The files in the template folder are modified after the cache is updated in central administration to take effect. Especially common.css that damn file.
The files in the root/data/folder are not all temporary caches, and cannot be deleted by one breath (delete the words and cry)
The modules in source/class/block/can be modified, see http://hi.baidu.com/xxfaxy/blog/item/f28dde62d4069dc1e7113afb.html for details.
These are some of my humble opinion, as a discuz beginner, feel the official information is somewhat obscure, for beginners more difficult to understand, I have this document to the general beginners of the beginner's pot friends.
Online Search of Literature:
Phpcms communication method with Ucenter: URL is missing
Discuz X2 data dictionary: http://wiki.blueidea.com/index.php?title=Discuz!X/%E6%95%B0%E6%8D%AE%E5%BA%93%E5%AD%97%E5%85%B8
How to DIY Portal: http://tech.cncms.com/cms/discuz/77137.html
Portal single page production: http://www.discuz.net/thread-2233010-1-1.html
Discuz Concise Introductory Tutorial