标签:
1、打开文件夹source\module\forum下的forum_viewthread.php,查找
function viewthread_updateviews($tableid) { global $_G; $viewrnd=rand(30,50); 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‘]); }
后台--全局--性能优化--服务器优化--是否优化更新主题浏览量:否--查看数开启防刷新:否,如下图所示
标签:
原文地址:http://www.cnblogs.com/LoveJulin/p/4468028.html