校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 網站建設 > 建站知識 > 讓DEDE評論蓋樓像騰訊 網易一樣顯示的實現方法

讓DEDE評論蓋樓像騰訊 網易一樣顯示的實現方法

POST TIME:2018-10-30 22:12

DEDE評論效果:

修改后的效果:

預覽地址:http://www.spenews.com/news/android-girl.html

修改步驟

一、5.5版本(5.6版本請往下看)
1、修改/plus/feedback_ajax.php文件的第131行(如果你沒改過)
下面是修改之前的代碼:

  1.  
  2. $qmsg = ‘{quote}{title}’.$row['username'].’ 的原帖:{/title}{content}’.$row['msg'].’{/content}{/quote}’;

下面是修改后的代碼:

  1.  
  2. //$qmsg = ‘{quote}{title}’.$row['username'].’ 的原帖:{/title}{content}’.$row['msg'].’{/content}{/quote}’;
  3. $floors = substr_count($row['msg'], ‘{title}’);//查找評論中樓層數
  4. if ($floors > 0) {
  5. $floors += 1;
  6. $floor_html = ‘{floor}’ . $floors . ‘{/floor}’;
  7. }
  8. else {
  9. $floor_html = ‘{floor}1{/floor}’;
  10. }
  11. $quotetitle = ‘{title}引用’ . $row['username'] . ‘的評論’. $floor_html .’{/title}’;
  12. $oldquote = ”;//以前的引用
  13. $quotemsg = $row['msg'];
  14. if ($floors > 0) {
  15. $oldquoteend = strrpos($quotemsg, ‘{/quote}’) + 8;
  16. $oldquote = substr($quotemsg, 0, $oldquoteend);
  17. $quotemsg = substr($quotemsg, $oldquoteend);
  18. }
  19. $qmsg = ‘{quote}’ . $oldquote . $quotetitle . ‘{content}’ . $quotemsg . ‘{/content}{/quote}’;

2、在/include/channelunit.func.php文件的516行,就是在return $quote;代碼前插入兩行代碼
下面是修改之前的代碼:

 

  1.  
  2. return $quote;

下面是修改之后的代碼:

 

  1.  
  2. $quote = str_replace(‘{floor}’,’<span class="floor">’,$quote);
  3. $quote = str_replace(‘{/floor}’,’</span>’,$quote);
  4. return $quote;

3、在/templets/style/dedecms.css文件末尾加入下面的CSS代碼(任意位置均可)

 

  1.  
  2. .floor {
  3. float:right;
  4. padding-right:10px;
  5. }

4、PHP技術有限,有更好的實現方法請指正,經以上修改失敗請回帖,修改成功后記得頂個貼^_^

二、5.6版本
1、修改/templets/plus/feedback_quote.htm文件的第94行(如果你沒改過)
下面是修改之前的代碼:

 

  1.  
  2. <input type="hidden" name="quotemsg" value="{quote}<?php echo ‘{title}’.$row['username'].’ 的原帖:{/title}{content}’.$row['msg'].’{/content}’; ?>{/quote}" />

下面是修改后的代碼:

 

  1.  
  2. <input type="hidden" name="quotemsg" value="<?php
  3. //echo ‘{quote}{title}’.$row['username'].’ 的原帖:{/title}{content}’.$row['msg'].’{/content}{/quote}’;
  4. floors = substr_count($row['msg'], ‘{title}’);//計算評論中樓層數
  5. if ($floors > 0) {
  6. $floors += 1;
  7. $floor_html = ‘{floor}’ . $floors . ‘{/floor}’;
  8. }
  9. else {
  10. $floor_html = ‘{floor}1{/floor}’;
  11. }
  12. $quotetitle = ‘{title}’ . $row['username'] . ‘的原帖’. $floor_html .’{/title}’;
  13. $oldquote = ”;//以前的引用
  14. $quotemsg = $row['msg'];
  15. if ($floors > 0) {
  16. $oldquoteend = strrpos($quotemsg, ‘{/quote}’) + 8;
  17. $oldquote = substr($quotemsg, 0, $oldquoteend);
  18. $quotemsg = substr($quotemsg, $oldquoteend);
  19. }
  20. echo ‘{quote}’ . $oldquote . $quotetitle . ‘{content}’ . $quotemsg . ‘{/content}{/quote}’;
  21. ?>" />

2、在/include/channelunit.func.php文件的519行,就是在return $quote;代碼前插入兩行代碼
下面是修改之前的代碼:

 

  1.  
  2. return $quote;

下面是修改之后的代碼:

 

  1.  
  2. $quote = str_replace(‘{floor}’,’<span class="floor">’,$quote);
  3. $quote = str_replace(‘{/floor}’,’</span>’,$quote);
  4. return $quote;

3、修改/templets/default/style/page.css文件的第1169行
下面是修改之前的代碼:

 

  1.  
  2. .decmt-content .decmt-box,.dede_comment .decmt-box .decmt-box {
  3. background:#FFE;
  4. border:1px solid #CCC;
  5. margin:6px auto;
  6. }

下面是修改之后的代碼:

 

  1.  
  2. /* .decmt-content .decmt-box,.dede_comment */.decmt-box .decmt-box {
  3. background:#FFE;
  4. border:1px solid #CCC;
  5. margin:6px auto;
  6. }
  7. .floor{
  8. float:right;
  9. padding-right:10px;
  10. }
  11. .decmt-title{
  12. margin-bottom:5px;
  13. }

4、PHP技術有限,有更好的實現方法請指正,經以上修改失敗請回帖,修改成功后記得頂個貼^_^



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 凭祥市| 公安县| 墨江| 富阳市| 盐边县| 上高县| 洛扎县| 信阳市| 锦州市| 平顶山市| 嘉禾县| 通道| 汝州市| 贵溪市| 孟津县| 盘锦市| 察隅县| 视频| 镶黄旗| 巴楚县| 龙州县| 军事| 类乌齐县| 霍邱县| 永平县| 合肥市| 安塞县| 温泉县| 盐山县| 奉化市| 邹平县| 息烽县| 青川县| 罗定市| 南召县| 留坝县| 额济纳旗| 雅江县| 阜宁县| 广南县| 巴南区|