织梦Dedecms 任意页面调用获取文章 评论数 和 收藏数

将以下内容保存为feedcount.php文件,放到plus目录下

/** * * 获取评论数c和收藏数f * * @version        $Id: feedcount.php 2013年3月3日 At:237606118  * @package        Douhuimai * @copyright      Copyright (c) 2013 Douhuimai. * @license        http://help.dedecms.com/usersguide/license.html * @link           http://www.douhuimai.com */document.write("<?phprequire_once(dirname(__FILE__)."/../include/common.inc.php");if(!empty($aid)){if($type=="c"){$row = $db->GetOne("select count(*) as c from dede_feedback where aid='{$aid}'");if($row['c']<1){echo "0";}else {echo $row['c'];}}else if($type=="f"){$frow = $db->GetOne("select count(*) as f from dede_member_stow where aid='{$aid}'");if($frow['f']<1){echo "0";}else {echo $frow['f'];}}}else{echo "0";}?>");

在任意页面调用评论数,aid为文章id

<script type="text/javascript" src="/plus/feedcount.php?aid=[field:id/]&type=c"></script>

调用收藏数

<script type="text/javascript" src="/plus/feedcount.php?aid=[field:id/]&type=f"></script>

旅行,其实是需要具有一些流浪精神的,

织梦Dedecms 任意页面调用获取文章 评论数 和 收藏数

相关文章:

你感兴趣的文章:

标签云: