织梦dede动态调用评论数
类别:建站知识   时间:03-06

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

document.write("共有<?phprequire_once(dirname(__FILE__)."/../include/common.inc.php");$row = $db->GetOne("select count(*) as fc from idea_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>


注:首页和列表均可采用此方法调用,标签方式改变一下就可以了。

智慧半岛,是一家专注于青岛网站建设青岛网站开发的青岛网络公司,Copyright ©2007-2019 Ebandao.Cn 版权所有 All Rights Reserved.(建议在1366x768以上的浏览器中访问)鲁ICP备08014496号

13153297890