dedecms5.7動態調用評論數和收藏數,織夢教程
導讀:織夢教程織夢教程很多時候,我們需要在頁面調用評論數和收藏數,織夢 dede 默認是不支持動態調用評論數和收藏數的,只能自己動手,現在和大家分享實現動態調用評論 數和收藏數的方法織夢模板織夢首頁模板。
很多時候,我們需要在頁面調用評論數和收藏數,織dede手機模板夢dede默認是不支持動態調用評論數和收藏數的,只能自己動手,現在和大家分享實現動態調用評論
數和收藏數的方法。
1、首先在根目錄plus/文件下創建文件名為fedcount.php的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'];
}
?>");
2、在需要放置手機模板dede評論數的位置,調用下面的js代碼即可
<script type="text/javascript" src="{dede:field name='pdede,模板hpurl'/}/fedcount.php?aid={dede:field.id/}"></script>
3、把下面的代碼保存為fedccount.php,記得修改數據庫前綴名
document.write("<?php require_once(dirname(__FILE__)."/../include/common.inc.php");
$row = $db->GetOne("select count(*) as c from dede_member_stow where aid='{$aid}' ");
if(!is_array($row))
{
echo "0";
}
else
{
echo $row['c'];
}
?>");
4、在需要放置評論數的位置,調用下面的js代碼即可
<script type="text/javascript" src="{dede:field name='phpurl'/}/fedccount.php?aid={dede:field.id/}"></script>相關織夢模板織夢首頁模板。
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-22 ,文章dedecms5.7動態調用評論數和收藏數,織夢教程主要講述標簽,標題,織夢網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_34356.html