查看: 9|回复: 0

指定天数回复后不自动顶帖

[复制链接]
  • 打卡等级:初来乍到
  • 打卡总天数:6
  • 打卡月天数:3
  • 打卡总奖励:27
  • 最近打卡:2025-01-21 08:39:34

91

主题

2

回帖

4364

积分

管理员

BSAY管理者

积分
4364
发表于 2025-1-20 15:17:56 | 显示全部楼层 |阅读模式
Xiuno BBS首页回复列表 30天前的帖子回复不置前设置,找到文件\model\post.func.php
找:// todo: 如果是老帖,不更新 lastpid
查找以下代码:
  1. thread__update($tid, array('posts+'=>1, 'lastpid'=>$pid, 'lastuid'=>$uid, 'last_date'=>$time));
复制代码
修改成以下代码:
  1. // 增加30天后的主题 不更新 lastpid
  2. $create = db_find_one('thread', array('tid'=>$tid));
  3. $create_date = $create['create_date'] + (30 * 24 * 60 * 60);
  4. if($create_date > $time){
  5. thread__update($tid, array('posts+'=>1, 'lastpid'=>$pid, 'lastuid'=>$uid, 'last_date'=>$time));
  6. }else{
  7. thread__update($tid, array('posts+'=>1, 'lastuid'=>$uid, 'last_date'=>$time));
  8. }
  9. // 增加30天后的主题 不更新 lastpid
复制代码
如果想改成其他日期,可以将30 * 24 * 60 * 60 的30改成你想要的天数,改成7就是一周时间内的帖子回复会置前。

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

本版积分规则

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