|
发表于 2015-11-18 10:56:47
|
显示全部楼层
|阅读模式
来自 中国–上海–上海
- 将以下内容保存为feedcount.php文件,放到plus目录下
在任意页面调用评论数,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> - document.write("<?php
- require_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";}
- ?>");
|
|