// 获取当前用户 UID $uid = $user['uid']; // 假设 $user 是当前用户信息的变量 // 获取当前时间戳 $currentTimestamp = time(); // 计算30天前的时间戳 $thirtyDaysAgoTimestamp = $currentTimestamp - (30 * 24 * 60 * 60); // 查询当前用户最近30天的发帖数 $postCount = db_count('thread',array('uid' => $uid, 'create_date'=>array('>'=>$thirtyDaysAgoTimestamp))); // 查询当前用户最近30天的回帖数 $replyCount = db_count('post', array('uid' => $uid,'isfirst' => 0,'create_date'=>array('>'=>$thirtyDaysAgoTimestamp))); // 输出结果 echo "当前用户最近30天的发帖数: $postCount\n"; echo "当前用户最近30天的回帖数: $replyCount\n";
确定要退出吗?