The method of realizing the number of floors in dedecms
This article will explain in detail the method of realizing the number of floors in dedecms. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
How does dedecms realize the number of floors?
DEDE comment effect:
The effect of the modification:
Modify step
I. version 5.5 (version 5.6, please read below)
1. Modify line 131 of / plus/feedback_ajax.php file (if you haven't changed it)
Here is the code before the modification:
$qmsg ='{quote} {title}'. $row ['username']. The original post: {/ title} {content}'. $row ['msg'].' {/ content} {/ quote}'
The following is the modified code:
The code is as follows:
/ / $qmsg ='{quote} {title}'. $row ['username']. The original post: {/ title} {content}'. $row ['msg'].' {/ content} {/ quote}'; $floors = substr_count ($row ['msg'],' {title}'); / / find the number of floors in the comment if ($floors > 0) {$floors + = 1th floor floorboards html ='{floor}'. $floors. '{/ floor}';} else {$floor_html ='{floor} 1 {/ floor}';} $quotetitle ='{title} reference'. $row ['username']. The comments. $floor_html.'{/ title}'; $oldquote =''; / / the previous reference $quotemsg = $row ['msg']; if ($floors > 0) {$oldquoteend = strrpos ($quotemsg,' {/ quote}') + 8 oldquoteend = substr ($quotemsg, 0, $oldquoteend); $quotemsg = substr ($quotemsg, $oldquoteend);} $qmsg ='{quote}'. $oldquote. $quotetitle. '{content}'. $quotemsg. '{/ content} {/ quote}'
2. In line 516 of the / include/channelunit.func.php file, insert two lines of code before the return $quote; code
Here is the code before the modification:
Return $quote
The following is the modified code:
The code is as follows:
$quote = str_replace ('{floor}','', $quote); $quote = str_replace ('{/ floor}','', $quote); return $quote
3. Add the following CSS code at the end of the / templets/style/dedecms.css file (anywhere)
The code is as follows:
.floor {float:right;padding-right:10px;}
4. PHP technology is limited. If there is a better way to implement it, please correct it. If you failed to modify the above, please reply. Remember to post the top ^ _ ^ after the modification is successful.
II. Version 5.6
1. Modify line 94 of the / templets/plus/feedback_quote.htm file (if you haven't changed it)
Here is the code before the modification:
The code is as follows: