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

admin 09月26日 212

<p>Xiuno BBS首页回复列表 30天前的帖子回复不置前设置,找到文件\model\post.func.php<br />找:// todo: 如果是老帖,不更新 lastpid<br />查找以下代码:</p>
<pre class="language-markup"><code>thread__update($tid, array('posts+'=&gt;1, 'lastpid'=&gt;$pid, 'lastuid'=&gt;$uid, 'last_date'=&gt;$time));</code></pre>
<p>修改成以下代码:</p>
<pre class="language-markup"><code>// 增加30天后的主题 不更新 lastpid

  1. $create = db_find_one('thread', array('tid'=&gt;$tid));
  2. $create_date = $create['create_date'] + (30 24 60 * 60);
  3. if($create_date &gt; $time){
  4. thread__update($tid, array('posts+'=&gt;1, 'lastpid'=&gt;$pid, 'lastuid'=&gt;$uid, 'last_date'=&gt;$time));
  5. }else{
  6. thread__update($tid, array('posts+'=&gt;1, 'lastuid'=&gt;$uid, 'last_date'=&gt;$time));
  7. }
  8. // 增加30天后的主题 不更新 lastpid</code></pre>
  9. <p>如果想改成其他日期,可以将30 24 60 * 60 的30改成你想要的天数,改成7就是一周时间内的帖子回复会置前。</p>

看过的人 (2)
  • 零点网络_1734128750
  • 修罗之家
最新回复 (14)
返回