POST TIME:2020-04-10 16:55
調(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的文件,代碼如下:
document.write("共有GetOne("select count(*) as fc from idea_feedback "); if(!is_array($row)){ echo "0"; }else { echo $row['fc']; } ?>條評(píng)論內(nèi)容!");第二步:然后在你的模板中需要顯示評(píng)論總數(shù)的地方,加入以下JS代碼:
<script type="text/javascript" src="{dede:field name='phpurl'/}/feedcount.php?aid={dede:field.id/}"> </script>