1、找到文件:source\module\forum下,forum_viewthread.php
2、找到1021行到1058行左右源代码如下
也可以直接改为数值,如10
——————————————————————————
- function viewthread_updateviews($tableid) {
- global $_G;
- $viewrnd=rand(1,10);
- if(!$_G['setting']['preventrefresh'] || $_G['cookie']['viewid'] != 'tid_'.$_G['tid']) {
- if(!$tableid && $_G['setting']['optimizeviews']) {
- if($_G['forum_thread']['addviews']) {
- if($_G['forum_thread']['addviews'] < 100) {
- C::t('forum_threadaddviews')->update_by_tid($_G['tid']);
- } else {
- if(!discuz_process::islocked('update_thread_view')) {
- $row = C::t('forum_threadaddviews')->fetch($_G['tid']);
- C::t('forum_threadaddviews')->update($_G['tid'], array('addviews' => 0));
- C::t('forum_thread')->increase($_G['tid'], array('views' => $row['addviews']+$viewrnd), true);
- discuz_process::unlock('update_thread_view');
- }
- }
- } else {
- C::t('forum_threadaddviews')->insert(array('tid' => $_G['tid'], 'addviews' => $viewrnd), false, true);
- }
- } else {
- C::t('forum_thread')->increase($_G['tid'], array('views' => $viewrnd), true, $tableid);
- }
- }
- dsetcookie('viewid', 'tid_'.$_G['tid']);
- }
复制代码
|