dedecms怎么实现楼层数

来源:undefined 2025-01-05 09:40:00 1047

dedecms怎么实现楼层数?

DEDE评论效果:

推荐:《dedecms教程

修改后的效果:

修改步骤

一、5.5版本(5.6版本请往下看)

1、修改/plus/feedback_ajax.php文件的第131行(如果你没改过)

下面是修改之前的代码:

1

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

登录后复制

下面是修改后的代码:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

//$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;代码前插入两行代码

下面是修改之前的代码:

1

return $quote;

登录后复制
登录后复制

下面是修改之后的代码:

代码如下:

1

2

3

$quote = str_replace({floor},<span>,$quote);

$quote = str_replace({/floor},</span>,$quote);

return $quote;

登录后复制
登录后复制

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

代码如下:

1

2

3

4

.floor {

float:right;

padding-right:10px;

}

登录后复制

4、PHP技术有限,有更好的实现方法请指正,经以上修改失败请回帖,修改成功后记得顶个贴^_^

二、5.6版本

1、修改/templets/plus/feedback_quote.htm文件的第94行(如果你没改过)

下面是修改之前的代码:

代码如下:

1

<input>{/quote}" /&gt;

登录后复制

下面是修改后的代码:

代码如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

<input floors if> 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 &gt; 0) {

$oldquoteend = strrpos($quotemsg, {/quote}) + 8;

$oldquote = substr($quotemsg, 0, $oldquoteend);

$quotemsg = substr($quotemsg, $oldquoteend);

}

echo {quote} . $oldquote . $quotetitle . {content} . $quotemsg . {/content}{/quote};

?&gt;" /&gt;

登录后复制

2、在/include/channelunit.func.php文件的519行,就是在return $quote;代码前插入两行代码

下面是修改之前的代码:

1

return $quote;

登录后复制
登录后复制

下面是修改之后的代码:

代码如下:

1

2

3

$quote = str_replace({floor},<span>,$quote);

$quote = str_replace({/floor},</span>,$quote);

return $quote;

登录后复制
登录后复制

3、修改/templets/default/style/page.css文件的第1169行

下面是修改之前的代码:

代码如下:

1

2

3

4

5

.decmt-content .decmt-box,.dede_comment .decmt-box .decmt-box {

background:#FFE;

border:1px solid #CCC;

margin:6px auto;

}

登录后复制

下面是修改之后的代码:

代码如下:

1

2

3

4

5

6

7

8

9

10

11

12

/* .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怎么实现楼层数的详细内容,更多请关注php中文网其它相关文章!

最新文章