织梦dedecms如何调用文章内容页的评论数?
织梦dedecms调用文章内容页的评论数
推荐学习:织梦cms
第一步:首先在plus目录下,建立一个文件名为:feedcount.php,代码如下:
document.write("共有<?phprequire_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'];}?>位用户了发表评论");
第二步:然后在你的模板中需要显示评论总数的地方,加入以下js代码:
<script type="text/javascript" src="{dede:field name='phpurl'/}/feedcount.php?aid={dede:field.id/}"></script>
以上就是织梦dedecms如何调用文章内容页的评论数的详细内容。