分享个帝国CMS函数,会员发布数量统计爽得不要不要的

查看 12|回复 0
作者:美文苑文学网   
分享个帝国CMS函数,会员发布数量统计爽得不要不要的

都认为小编长期灌水。都没有来点实际的,现在现在小编分享个自定义函数,会员发布数量统计爽得不要不要的。代码如下
[ol]
  • function get_user_article_stat($uid, $type = 'all', $cache_ttl =3600*24*1){
  • global $dbtbpre;
  • $userid = intval($uid);$sql = '';
  • switch ($type) {
  • case 'month': //近30天投稿数
  • $first_days_ago = strtotime(date('Y-m-d 00:00:00') . ' -30 days');//最近30天
  • $sql = "select count(*) as total from {$dbtbpre}ecms_article where userid='$userid' and ismember=1 and newstime>$first_days_ago";
  • break;
  • case 'mqiandao': //本月签到数(自然月)
  • $month_start = strtotime(date('Y-m-01', time()) . ' 00:00:00'); // 获取当前月份的第一天(00:00:00)的UNIX时间戳
  • $end = time();
  • $sql = "select sum(qdcs) as total from {$dbtbpre}enewsmemberqiandao where userid='$userid' and time >= {$month_start} and time 复制代码注释得明明白白的!看懂了吧!方便吧!(本函数已经生产用于文韵坊阅读网几年稳稳的)只能说明会员调用发布数量统计爽得不要不要的,一个字爽,两个字很爽,三个字非常爽

    总数, 函数

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

    返回顶部