使用织梦cms搭建网站时,想要调用文章评论数量如何实现,今天小编为大家分享一个方法,快来看看吧!
找到根目录下的/plus/文件,plus文件里创建feedcount.php,代码如下↓
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']; } ?>位用户了发表评论"); |
调用代码如下↓
<script type="text/javascript" src="{dede:field name='phpurl'/}/feedcount.php?aid={dede:field.id/}"></script> |
记得清理缓存哦,希望可以帮助到您!