织梦DedeCMS如何调用文章内容页的评论数

来源:undefined 2025-01-03 13:02:53 1068

织梦dedecms如何调用文章内容页的评论数?

织梦DedeCMS调用文章内容页的评论数

推荐学习:织梦cms

第一步:首先在plus目录下,建立一个文件名为:feedcount.php,代码如下:

1

2

3

4

5

6

7

8

document.write("共有<?php require_once(dirname(__FILE__)."/../include/common.inc.php");

$row = $db->GetOne("select count(*) as fc from dede_feedback where aid={$aid}");

if(!is_array($row)){

echo "0";

}else {

echo $row[fc];

}

?&gt;位用户了发表评论");

登录后复制

第二步:然后在你的模板中需要显示评论总数的地方,加入以下JS代码:

1

<script></script>

登录后复制

以上就是织梦DedeCMS如何调用文章内容页的评论数的详细内容,更多请关注php中文网其它相关文章!

最新文章