調(diào)用織夢(mèng)全站評(píng)論總數(shù)其實(shí)很簡(jiǎn)單,比如用dedecms搭建博客類(lèi)型的網(wǎng)站就可以用該方法調(diào)用評(píng)論總數(shù),本文給大家介紹一個(gè)簡(jiǎn)單的方法,使用JS調(diào)用評(píng)論,而且可以使用到DEDECMS中的任何地方!
第一步:首先在plus目錄下,建立一個(gè)名為feedcount.php的文件,代碼如下:
1
2 3 4 5 6 7 8 9 |
document.write("共有<?php
require_once(dirname(__FILE__)."/../include/common.inc.php"); $row=$db->GetOne("select count(*) as fc from dede_feedback "); if(!is_array($row)){ echo"0"; }else{ echo$row['fc']; } ?>條評(píng)論內(nèi)容!"); |
第二步:然后在你的中需要顯示評(píng)論總數(shù)的地方,加入以下JS代碼:
1
|
<script type="text/javascript"src="{dede:field name='phpurl'/}/feedcount.php?aid={dede:field.id/}"></script>
|