当前位置:Gxlcms > PHP教程 > Disucz修改帖子查看数的方法·····刷新一次增加为N

Disucz修改帖子查看数的方法·····刷新一次增加为N

时间:2021-07-01 10:21:17 帮助过:27人阅读

打开:在source\module\forum下,forum_viewthread.php打开,找到
  1. C::t('forum_thread')->increase($_G['tid'], array('views' => $row['addviews']+1), true);
  2. discuz_process::unlock('update_thread_view');
  3. }
  4. }
  5. } else {
  6. C::t('forum_threadaddviews')->insert(array('tid' => $_G['tid'], 'addviews' => 1), false, true);
  7. }
  8. } else {
  9. C::t('forum_thread')->increase($_G['tid'], array('views' =>1), true, $tableid);
把上面代码里面的 3处 1 改成N(你想要的数值)

例如:
  1. C::t('forum_thread')->increase($_G['tid'], array('views' => $row['addviews']+3), true);
  2. discuz_process::unlock('update_thread_view');
  3. }
  4. }
  5. } else {
  6. C::t('forum_threadaddviews')->insert(array('tid' => $_G['tid'], 'addviews' => 3), false, true);
  7. }
  8. } else {
  9. C::t('forum_thread')->increase($_G['tid'], array('views' =>3), true, $tableid);

人气教程排行