需求:需要屏蔽掉老帖子在App内的显示
效果:根据时间屏蔽掉帖子
修改:
source/plugin/qianfan/protected/controllers/ThreadController.php
搜索:
- if ($topic['closed'] && $topic['closed'] != 1) {
- $tid = $topic['closed'];
- $topic['tid'] = $tid;
- }
复制代码
下面添加:
- if($topic["dateline"]<strtotime("2021-1-30 00:00:00")){
- $tid=0;
- $topic=array();
- }
复制代码
其中2021-1-30 00:00:00 为想屏蔽多久之前的时间。
更新缓存,完成 |