Discuz Forum Structure

Source: Internet
Author: User
Tags bbcode php database php editor php email php template

Tens of thousands of Discuz! Learn more about Discuz! I am familiar with Discuz! In the process, I will write my personal experience to you by the way. The content of this post is updated on a regular basis. This post only describes Discuz! Some technical points in the Section are my personal points of view. If you have any shortcomings, please kindly advise. Thank you first !. "Discuz !" In this article, "DZ" is short ". To achieve secondary DZ development, you must have at least the following skills:
1) be able to understand the principles of the MVC Architecture well (although DZ is not of the MVC Architecture)
2) solid PHP Foundation, familiar with structured programs, writing and Application of OOP programs
3) familiar with MYSQL, master the SQL language, and better understand SQL Optimization
4) familiar with Discuz! Functions
1) Discuz! File System Directory
Note: To develop DZ, you must understand the functions of each file in DZ.
A) Admin: backend Management Module
B) Api: interface program between DZ system and other systems
C) Archiver: The graph-free version used for Search Engine Optimization in DZ
D) Attachments: directory where Attachments are uploaded in DZ.
E) Customavatars: directory of the custom avatar in DZ
F) Forumdata: DZ cache data storage directory
G) Images: directory for storing Images in the DZ Template
H) Include: Common DZ function libraries, basic function modules
I) Ipdata: DZ collects IP address traffic data
J) Plugins: directory for storing DZ plug-in information
K) Templates: directory for storing DZ template files
L) Wap: DZ wireless, Wap program processing Directory
(2) You must be familiar with Discuz! The functions of each table and each field in each table are designed by the database.
For DZ database design documents, see DZ related project documents (Please download from the attachment below)
3) Discuz! Process Control
A) Background Stream Control: All DZ background functions must be registered with admincp. PHP file, each function has at least one or more actions, in admincp. in php, you can define the execution permissions of actions, which are: "admin = 1" Administrator, or "admin = 2 | admin = 3" Super moderator and moderator, each Action corresponds to a script file named action. inc. php (*. inc. php) in the admin directory, such as admincp. php? Action = dodo, which is equivalent to executing the dodo. inc. php file under the admin directory
B) Foreground process control: the foreground process control is relatively simple: the process is free, for example:
Home page: index. php
Member registration: register. php;
Member Logon: logging. php
Post program: post. php
Member information: member. php
Forum content: forumdisplay. php
View post: viewthread. php
... Most of the functions are not listed here...
C) config. inc. php under the root directory of DZ is the configuration file of the entire DZ system.
4) Discuz! Data Processing Process
A) DZ processes mysql database operations in the dbstuff (db_mysql.class.php) class.
B) The external data is preliminarily filtered by "daddslashes ()", then filtered, and processed as needed.
5) Discuz! Display Control (website layout style output)
A) The display layer is the website style that we usually see. In DZ, each wind network corresponds to a storage directory of style files under templates and images respectively. For more information about website style production, see DZ style production documentation.
B) DZ website Style File Processing Principle: in fact, it is very simple. DZ uses template. func. in php, parse_template () converts the template tag in the htm model file to the PHP code using the PHP regular operation, and saves it under forumdata/templates according to the styleid. This is a bit like the technology in Smarty.
6) DZ Language Processing
A) DZ foreground, background, and English language Implementation define statements as language variables, and then input the statements in the template and assign values to the statement variables in the template directory *. lang. in the PHP file, DZ loads the corresponding language pack when generating the website style.
7) How DZ processes user information (access, computing, and update processes)
New users must master the meaning of each array element in the array for secondary development.
A) The basic information of DZ, such as user information, and Session information exist in the following variables:
A). $ _ DCACHE
B). $ _ COOKIE
C). $ _ DCOOKIE
D). $ _ DSESSION
E). $ _ DPLUGIN
B) print all variables through print_r ($ GLOBALS ).
8) cache Processing Mechanism in DZ
A) the cache processing process in DZ is put in "cache. func. in php, DZ cache processing is relatively simple. The principle is to convert an array into PHP code and save it in the cache directory. You can open the cache file to view it.
B) usage: if some data needs to be cached in the new function, it is basically:
1) Define and register the cache name.
2) read the corresponding data from the data.
3) data is processed before being written to the cache.
4) write data to the cache.
For specific operations, you can view the code in the file and modify the code accordingly.
9) template Processing Mechanism in DZ
A) the original template Processing Technology of DZ is similar to template processing in Smarty. It is only a specific algorithm and has different processes. Smarty is a heavy template engine solution. The principle is to convert the variables in the template into the corresponding PHP code. This process is actually a compilation in JAVA and runs in multiple places.
10) Permission Handling Mechanism in DZ
A) each action in the DZ foreground has a $ discuz_action definition. DZ determines whether the user has the permission to operate $ discuz_action based on the user group. For permission verification on the background, it is simpler to determine based on "admin = 1"
11) How to Achieve URL static in DZ
A) There are two static methods in DZ. As long as you know the ReWrite plan, you will know it at a glance.
12) How to intercept and use the original HTML editor of DZ, if it is used for Discuz! Conversion of generation and Html code
A) This is also a relatively good DZ technology. In earlier versions, due to the lack of DZ editors, many users gave up DZ. Implementation principle: convert some operations used into the bbcode code of DZ through JS. In this way, the security is submitted, and the content with bbcode code is stored in data. When a user opens a page, the bbcode code is converted into html code.
This post statement: due to limited time, this post only provides a brief analysis of some DZ functions. If you are interested in this article and want to learn more about DZ, post it here! I will write as many DZ technical analyses as possible in this article, and constantly update the content of this post.
Description of some files:
Admincp. php Management
Ajax. php ajax Functions
Announcement. php announcement
Attachment
Real homepage of board. php
Config. inc. php: Configuration File
Corpus. php Forum collection
Digest. php excellent post
Discuz_version.php Forum version
Faq. php question list
Forumdisplay. php Forum list
Index. php jump page
Loggin. php authentication page (login and Exit)
Mail_config.inc.php mail configuration
Member. php user operations
Memcp. php personal control panel
Misc. php fragmentation
My. php my post
Plugin. php plug-in
Pm. php text message
Post. php
Redirect. php page redirection
Register. php
Robots.txt Restricted Search
Rss. php rss information release
Search. php Forum Query
Secode. php Verification Code
Stats. php statistics
Topic. php homepage Forum topics
Topic Management in topicadmin
Viewpro. php displays personal information
Viewthread. php topic display
Folder
Admin Management
API
Archiver document
Attachments attachment
Custom mavatars
Forumdata Forum data contains buffered data
Images Image
Include public files
Install installation package
Ipdata IP Address
Plugins
Readme help document
Templates Template
Utilities Toolkit
WAP mobile website
Folder include
Advertisements. Inc. php advertising management
Ajax. js Ajax-related
Attachment. func. php attachment function set
Bbscode. js Forum expressions
Cache. Fun. php cache function set
Category. Inc. php
Chinese. Class. php
Common. Inc. php main header file
Common. js main JS files
Corpus. func. php Forum collection function
Counter. Inc. php Forum count
Cron. func. php schedules tasks
Db_mysql.class.php Database
Db_mysql_error.inc.php Database Error
Debug. php debugging information
Discuzcode. func. php Forum code
Editor. func. php editor
Editor. js editor
Editpost. inc. php edit post
Floatadv. js floating Advertisement
Forum. func. php forum function set
Global. func. php global functions
Menu. js menu
Misc. func. php others
Newreply. inc. php new reply
Newthread. inc. php new theme
* Pmprompt. inc. php
Post. fun. php post topic
Printable. inc. php Forum Printing
Qihoo. js qihoo
Relatethreads. inc. php topics
Security. inc. php security
Sendmail. inc. php email
Serverbusy.htm system busy
Template. func. php template
Threadpay. inc. php purchase post

 

From: http://blog.csdn.net/phphot/archive/2007/12/14/1934421.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.