這篇教程教大家織夢cms內容頁調用評論數量的方法,希望對大家有所幫助!

織夢cms內容頁調用評論數量的方法
1、在織夢程序的plus文件夾新建php文件并命名為feedcount.php,在其中添加代碼:
document.write("共有
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'];
}?>位用戶了發表評論");2、在要顯示評論總數的位置添加JS調用代碼:
<script type="text/javascript" src="{dede:field name='phpurl'/}/feedcount.php?aid={dede:field name='id'/}&mid={dede:field name='mid'/}" type='text/javascript' language="javascript"></script>這樣就實現了在織夢cms內容頁調用評論數量。你學會了嗎?






