
dedecmsHow to realize the number of floors?
DEDE comment effect:
Recommended: "dedecms tutorial"


$qmsg = '{quote}{title}'.$row['username'].' 的原帖:{/title}{content}'.$row['msg'].'{/content}{/quote}';The following is the modified code:The code is as follows ://$qmsg = '{quote}{title}'.$row['username'].' 的原帖:{/title}{content}'.$row['msg'].'{/content}{/quote}';
$floors = substr_count($row['msg'], '{title}');//查找评论中楼层数
if ($floors > 0) {
$floors += 1;
$floor_html = '{floor}' . $floors . '{/floor}';
}
else {
$floor_html = '{floor}1{/floor}';
}
$quotetitle = '{title}引用' . $row['username'] . '的评论'. $floor_html .'{/title}';
$oldquote = '';//以前的引用
$quotemsg = $row['msg'];
if ($floors > 0) {
$oldquoteend = strrpos($quotemsg, '{/quote}') + 8;
$oldquote = 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; codeThe following is the code before modification:return $quote;The following is the modified code: The code is as follows:
$quote = str_replace('{floor}','<span class="floor">',$quote);
$quote = str_replace('{/floor}','</span>',$quote);
return $quote;3. Add the following CSS code (anywhere) at the end of the /templets/style/dedecms.css file All are OK)The code is as follows:.floor {
float:right;
padding-right:10px;
}4. PHP technology is limited. If you have a better implementation method, please correct me. If the above modification fails, please reply. If the modification is successful, remember to like it^_ ^2. Version 5.61. Modify line 94 of the /templets/plus/feedback_quote.htm file (if you have not changed it)The following is before modification Code: The code is as follows:<input type="hidden" name="quotemsg" value="{quote}<?php echo '{title}'.$row['username'].' 的原帖:{/title}{content}'.$row['msg'].'{/content}'; ?>{/quote}" />The following is the modified code:The code is as follows:<input type="hidden" name="quotemsg" value="<?php
//echo '{quote}{title}'.$row['username'].' 的原帖:{/title}{content}'.$row['msg'].'{/content}{/quote}';
floors = substr_count($row['msg'], '{title}');//计算评论中楼层数
if ($floors > 0) {
$floors += 1;
$floor_html = '{floor}' . $floors . '{/floor}';
}
else {
$floor_html = '{floor}1{/floor}';
}
$quotetitle = '{title}' . $row['username'] . '的原帖'. $floor_html .'{/title}';
$oldquote = '';//以前的引用
$quotemsg = $row['msg'];
if ($floors > 0) {
$oldquoteend = strrpos($quotemsg, '{/quote}') + 8;
$oldquote = substr($quotemsg, 0, $oldquoteend);
$quotemsg = substr($quotemsg, $oldquoteend);
}
echo '{quote}' . $oldquote . $quotetitle . '{content}' . $quotemsg . '{/content}{/quote}';
?>" />2. In/include/channelunit.func Line 519 of the .php file is to insert two lines of code before the return $quote; codeThe following is the code before modification:return $quote;The following is the code after modification:The code is as follows:
$quote = str_replace('{floor}','<span class="floor">',$quote);
$quote = str_replace('{/floor}','</span>',$quote);
return $quote;3. Modify line 1169 of the /templets/default/style/page.css file The following is the code before modification: Code As follows:.decmt-content .decmt-box,.dede_comment .decmt-box .decmt-box {
background:#FFE;
border:1px solid #CCC;
margin:6px auto;
}The following is the modified code:The code is as follows:/* .decmt-content .decmt-box,.dede_comment */.decmt-box .decmt-box {
background:#FFE;
border:1px solid #CCC;
margin:6px auto;
}
.floor{
float:right;
padding-right:10px;
}
.decmt-title{
margin-bottom:5px;
}The above is the detailed content of How does dedecms realize the number of floors. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver CS6
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.





