Analyze the process and principle of Discuz Forum's reply.

time:15-05-25 forum:PHP tools and code
  http://www.php1.cn/article/54833.html

replies can also add hidden tags,
as long as users use hide tags permissions, the content will be displayed when users reply to the topic. Replies are also valid for visitors,

when a user is posting a hide tag when a post is posted, the discuzcode function is invoked to parse the discuz code when the theme is published, which parses the hide label part:
[code]if ($parsetype! = 1.Amp;.Amp; strpos)! = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
[code]if ($parsetype! = 1.Amp;.Amp; strpos)! = = = = = = = FALSE.Amp;.Amp; $pid) {
if (strpos ($msglower,'.#91; hide.#93; ")! = = FALSE) #91;'forum'.#93;.#91;'ismoderator'.#93; DB:: result_first (.Quot; SELECT PID FROM.Quot;.DB:); : TRUE;
}
if ($authorreplyexist) {
$message = preg_replace (.Quot; /.#91; hide.#93; s* (. *?)) Lace (.Quot; /.#91; hide.#93; (*?).#91; /hide.#93; /is.quot; tpl_hide_reply_hidden (), $message);
$message. ='.lt. If (strpos ($msglower,'.#91; hide=')! = = FALSE) {
$message = preg_replace (.Quot; /.#91; hide=). Br />
because of the post table, the subject is also the existence of the
[code]$authorreplyexist =! $_G.#91;'forum'.#93;.#91;'ismoderator'.#93; DB:: result_first. Uid.#93;'.quot;.Quot; authorid=0 AND useip='$_G.#91; clientip.#93;'.quot;..quot; LIMIT 1.quot;): TRUE; #93; /is.quot; tpl_hide_reply (), $message) [/code]
replace the code of the hide label part,
with tpl_hide_reply_hidden () to remove the content of the hide tag part,

the function here comes from: discuzcode.htm, the function principle of which is not introduced here.

prev:The setcookie function of PHP next:960gs tips- assists designers to create ...
post comment
Notice



approved   How the deaf and dumb girls become t...   These old photos of Ji'nan, which ha...   What can you eat for 10 dollars? The...   Through a hundred years, take you to...   26 mountain parks all over Ji'nan
rand   PHP import and export of Excel file ...      PHP filter special characters and SQ...   PHP gets all the pictures in the web...   PHP regularly gets the picture and d...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com