
歡迎訪問(wèn)全國(guó)企業(yè)網(wǎng)站設(shè)計(jì)NO.1網(wǎng)站開(kāi)發(fā)商平臺(tái) | 付款方式 |
POST TIME:2020-10-09
網(wǎng)站中只要啟用了會(huì)員系統(tǒng),網(wǎng)站中的文章就會(huì)有評(píng)論,在網(wǎng)站首頁(yè)中調(diào)用會(huì)員評(píng)論也能提升會(huì)員體驗(yàn)度,網(wǎng)頁(yè)都是靜態(tài)頁(yè)面,如果每有一個(gè)評(píng)論都更新html的話就會(huì)有點(diǎn)浪費(fèi)資源了,所以這里給大家分享一個(gè)使用JS調(diào)用的方法。
1、在plus文件夾下面新建fedcount.php文件 內(nèi)容如下
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'];
}
?>位用戶了發(fā)表評(píng)論”);
2、在內(nèi)容頁(yè)模板中插入如下代碼調(diào)用
<script type=”text/javascript” src=”/plus/fedcount.php?aid={dede:field name=ID/}”></script>
3、在列表頁(yè)或首頁(yè)模板中插入如下代碼
<script type=”text/javascript” src=”/plus/feedcount.php?aid=[field:id/]“></script>
巨號(hào)網(wǎng)網(wǎng)站開(kāi)發(fā)部為全國(guó)企業(yè)提供網(wǎng)頁(yè)設(shè)計(jì)和專(zhuān)業(yè)的公司網(wǎng)站制作等相關(guān)建站服務(wù),并提供24小時(shí)企業(yè)網(wǎng)站設(shè)計(jì)咨詢!
關(guān)于我們 建站知識(shí) 榮譽(yù)資質(zhì)網(wǎng)站地圖