Turn: http://hi.baidu.com/anvycn/blog/item/b780f319b732e57edbb4bd64.html 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 regularly updated by this person. 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 6.0 Structure Administrative Program (background): admincp. php actually implements various functional modules by calling the *. inc. php program under the admin folder. AJAX function: ajax. php Forum announcement: announcement. php Attachment: attachment. php Blog. php Configuration File: config. inc. php Crossdomain. xml Excellent post: digest. php Forum version: discuz_version.php Eccredit. php Forum Faq (problem): faq. php Content (section) List: forumdisplay. php Frame. php Home page: index. php Installer: install. php Invite. php Left/right column: leftmenu. php Log on to the logout program: logging. php Item store: magic. php Member information: member. php Member Control Panel: memcp. php Fragmented functions: misc. php Double-click to edit the post: modcp. php [My] function: my. php Plug-in program: plugin. php Forum short message: pm. php Post program: post. php Page redirection (redirection): redirect. php Registration Program: register. php Relatekw. php Reply to post: relatethread. php RSS customization: rss. php Search for the Forum: search. php Verification Code Program: seccode. php Forum map: sitemap. php Space: space. php Statistics: stats. php Tags: tag. php Homepage forum topic: topic. php Topic management topcadmin. php Trade. php Member personal information: viewpro. php View post: viewthread. php Folder: Admin management folder [including functions of various background modules] Api interface folder [provides interfaces with other CMS] Archiver static no-graph document folder Attachments attachment [various files uploaded at the front end] Custom mavatars Forumdata Forum backup data and Cache Images image [Forum images include images used by various templates] Include public folder [all core dz programs are in it] Install installation package Ipdata IP Address Plugins plugin folder [standard plugin] Templates template folder Wap mobile website folder After dz6.0, folders are classified and separated by js and php. Javascript is stored in the javascript folder. For individuals, the naming rules of discuz are as follows: . Php. It's a program ~ . Inc. php is a related [function file]. For example, newthread. inc. php is a feature related to a new topic. . Func. php is a related [function file]. For example, global. func. php is a global function. . Class. php is a [class file]. For example, mysql operations are stored in the db_mysql.class.php file. + [Folder include] + [Crons folder] Announcements_daily.inc.php Birthdays_daily.inc.php Cleanup_daily.inc.php Cleanup_monthly.inc.php Magics_daily.inc.php Notify_daily.inc.php Onlinetime_monthly.inc.php Promotions_hourly.inc.php Secqaa_daily.inc.php Supe_daily.inc.php Tags_daily.inc.php Threadexpiries_hourly.inc.php Todayposts_daily.inc.php + [Javascript folder] Ajax. js Bbcode. js Calender. js Common. js Drag. js Drag_space.js Editor. js Floatadv. js Google. js Iframe. js Insenz_reg.js Menu. js Msn. js Post. js Post_attach.js Qihoo. js Tree. js Viewthread. js + [Magic folder] Magic_close.inc.php Magic_color.inc.php Magic_del.inc.php Magic_hidden.inc.php Magic_money.inc.php Magic_move.inc.php Magic_open.inc.php Magic_renew.inc.php Magic_reporter.inc.php Magic_see.inc.php Magic_top.inc.php Magic_up.inc.php + [Tables folder] Big5-unicode.table Gb-unicode.table
Advertisements. inc. php Attachment. func. php attachment function set Cache. func. php cache function set Category. inc. php Chinese. class. php Common. inc. php main header file Counter. inc. php Forum count Cron. func. php schedules tasks Db_mysql.class.php Database Db_mysql.error.inc.php Database Error Discuzcode. func. php Forum code Ec_credit.func.php Editor. func. php editor Editpost. inc. php edit post Forum. func. php forum function set Http://www.cnblogs.com/redfox241/admin/ftp://ftp.func.php/ Gifmerge. class. php Global. func. php global functions Image. class. php Insenz. func. php Insenz_cron.func.php Magic. func. php Misc. func. php others Moderatio. inc. php Newrepley. inc. php new reply Newthread. inc. php new theme Newtrade. inc. php new activity Pprompt. inc. php Post. func. php post topic Printable. inc. php Forum Printing Promotion. inc. php Search_qihoo.inc.php Search_trade.inc.php Search_type.inc.php Security. inc. php security Sendmail. inc. php email Serverbusy.htm system busy Space. func. php Supesite. func. php Supesite_circle.inc.php Supesite_import.inc.php Temple. func. php Template Treadpay. inc. php purchase post Viewpro. inc. php personal information Viewthread_activity.inc.php activity topic Viewthread_debate.inc.php Debate topic Viewthread_poll.inc.php voting topic Viewthread_reward.inc.php reward topic Viewthread_special.inc.php activity topic Viewthread_trade.inc.php product topic Viewthread_video.inc.php video topic Xmlparser. class. php |