【CMS体系建站】dedecms怎样完成楼层数
2019-11-20cms搜奇网68°c
A+ A-dedecms怎样完成楼层数?
DEDE批评结果:
引荐:《dedecms教程》
修正后的结果:
修正步骤
一、5.5版本(5.6版本请往下看)
1、修正/plus/feedback_ajax.php文件的第131行(假如你没悛改)
下面是修正之前的代码:
$qmsg = '{quote}{title}'.$row['username'].' 的原帖:{/title}{content}'.$row['msg'].'{/content}{/quote}';
下面是修正后的代码:
代码以下:
//$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、在/include/channelunit.func.php文件的516行,就是在return $quote;代码前插进去两行代码
下面是修正之前的代码:
return $quote;
下面是修正以后的代码:
代码以下:
$quote = str_replace('{floor}','<span class="floor">',$quote); $quote = str_replace('{/floor}','</span>',$quote); return $quote;
3、在/templets/style/dedecms.css文件末端到场下面的CSS代码(恣意位置都可)
代码以下:
.floor { float:right; padding-right:10px; }
4、PHP手艺有限,有更好的完成要领请斧正,经以上修正失利请回帖,修正胜利后记得顶个贴^_^
二、5.6版本
1、修正/templets/plus/feedback_quote.htm文件的第94行(假如你没悛改)
下面是修正之前的代码:
代码以下:
<input type="hidden" name="quotemsg" value="{quote}<?php echo '{title}'.$row['username'].' 的原帖:{/title}{content}'.$row['msg'].'{/content}'; ?>{/quote}" />
下面是修正后的代码:
代码以下:
<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、在/include/channelunit.func.php文件的519行,就是在return $quote;代码前插进去两行代码
下面是修正之前的代码:
return $quote;
下面是修正以后的代码:
代码以下:
$quote = str_replace('{floor}','<span class="floor">',$quote); $quote = str_replace('{/floor}','</span>',$quote); return $quote;
3、修正/templets/default/style/page.css文件的第1169行
下面是修正之前的代码:
代码以下:
.decmt-content .decmt-box,.dede_comment .decmt-box .decmt-box { background:#FFE; border:1px solid #CCC; margin:6px auto; }
下面是修正以后的代码:
代码以下:
/* .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; }
以上就是dedecms怎样完成楼层数的细致内容,更多请关注ki4.cn别的相干文章!
标签:dedecms