Analyze the processing process and principle of visible Reply to Discuz Forum
Source: Internet
Author: User
You can also add hidden tags to the reply content. as long as you use the hide tag permission, when the user replies to the topic, the content will be displayed and the reply will be visible to visitors, when a user uses the hide tag when posting a topic, the discuzcode function is called to parse the discuz code when releasing the topic. the hidden tag can also be added when parsing the content of the hide tag reply, as long as the user uses the hide label permission, when the user replies to the topic, the content will also be displayed as a reply, which is also valid for tourists, when a user uses the hide tag when posting a topic, it calls
DiscuzCode function pair
DiscuzThe code is parsed. parse the hide tag section:
If ($ parsetype! = 1 & strpos ($ msglower, '[/hide]')! ==False & $ pid ){
If (strpos ($ msglower, '[hide]')! = FALSE ){
If ($ authorreplyexist === null ){
$ Posttable = getposttablebytid ($ _ G ['tid']);
$ Authorreplyexist =! $ _ G ['forum'] ['isderator']? DB: result_first ("SELECT pid FROM ". DB: table ($ posttable ). "WHERE tid = '$ _ G [tid]' AND ". ($ _ G ['uid']? "Authorid = '$ _ G [uid]'": "authorid = 0 AND useip = '$ _ G [clientip]'"). "LIMIT 1"): TRUE;
}
If ($ authorreplyexist ){
$ Message = preg_replace ("/[hide] s *(.*?) S * [/hide]/is ", tpl_hide_reply (), $ message );
} Else {
$ Message = preg_replace ("/[hide] (. *?) [/Hide]/is ", tpl_hide_reply_hidden (), $ message );
$ Message. ='
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