如果你喜欢本站请点击 Ctrl + D 收藏本站!

当前位置:主页 > 站长资讯 > 资讯文章 > 建站技术 >

论坛人气弱?Discuz帖子刷新后阅读数进行随机值

来源:未知 浏览:次 时间:2020-11-21
论坛人气弱?想改阅读数的站长可以围观!找到:source/module/forum/forum_viewthread.php文件搜索代码:function viewthread_updateviews($tableid)找到代码:function viewthread_updateviews($tableid) { global $_G; 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']+1), true); discuz_process::unlock('update_thread_view'); } } } else { C::t('forum_threadaddviews')->insert(array('tid' => $_G['tid'], 'addviews' => 1), false, true); } } else { C::t('forum_thread')->increase($_G['tid'], array('views' => 1), true, $tableid); } } dsetcookie('viewid', 'tid_'.$_G['tid']);}修改为:function viewthread_updateviews($tableid) { global $_G; $viewrand = rand(2,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' => $viewrand)); C::t('forum_thread')->increase($_G['tid'], array('views' => $row['addviews']+$viewrand), true); discuz_process::unlock('update_thread_view'); } } } else { C::t('forum_threadaddviews')->insert(array('tid' => $_G['tid'], 'addviews' => $viewrand), false, true); } } else { C::t('forum_thread')->increase($_G['tid'], array('views' => $viewrand), true, $tableid); } } dsetcookie('viewid', 'tid_'.$_G['tid']);}