网站模板中心

您现在的位置:首页>>织梦大学>>织梦技巧

织梦调用列表页、文章页评论数和收藏数代码

来源: 编辑:admin 发布时间:2020-03-24热度:64 ℃
下面代码可以根据自己需要,在列表页或文章页显示被评论次数和收藏次数。 文章页调用评论数 1 {dede:field. id runphp= yes } 2 global $dsql; 3 $dsql - SetQuery( Select count(id) as c from dede_feedback whe...

下面代码可以根据自己需要,在列表页或文章页显示被评论次数和收藏次数。

文章页调用评论数

1 {dede:field.id runphp='yes'
2 global $dsql;
3 $dsql -> SetQuery("Select count(id) as c from dede_feedback where aid=".@me);
4 $row = $dsql -> getone();@me=$row['c'];
5 {/dede:field.id}个评论

文章页调用收藏数

1 {dede:field.id runphp='yes'
2 global $dsql;
3 $dsql -> SetQuery("select count(*) as c from dede_member_stow where aid=".@me);
4 $row = $dsql -> getone();@me=$row['c']; 
5 {/dede:field.id}次

列表页调用评论数

1 [field:ID runphp='yes'
2 global $dsql;
3 $dsql -> SetQuery("Select count(id) as c from dede_feedback where aid=".@me);
4 $row = $dsql -> getone();@me=$row['c']; 
5 [/field:ID]

Pbootcms问题解决

请点击在线联系我们【点击咨询解决问题】   如果您有任何Pbootcms问题,我们将免费为您写解决教程!

    PB模板网:承接仿站业务,价格200元起!