找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

destoon自定义函数最新被收藏数量统计调用

[复制链接]
发表于 2020-9-15 23:51:34 | 显示全部楼层 |阅读模式
在api/extend.func.php 中加入以下函数
  1. //获取单个信息被收藏数

  2. function xh_favorite($mid,$itemid){

  3. global $db;

  4. $nums = $db->get_one("SELECt COUNT(*) AS num FROM {$db->pre}favorite WHERe mid='$mid' and tid='$itemid'");

  5. return $nums['num'] ;

  6. }
复制代码
列表调用标签  {xh_favorite($mid,$t[itemid])}
内容页调用标签  {xh_favorite($mid,$itemid)}
完美的被收藏统计

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|知识在线

GMT+8, 2026-11-2 22:22 , Processed in 0.144824 second(s), 21 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表