Home >Backend Development >PHP Tutorial >Disucz's method of modifying the number of post views·····Refresh once and increase it to N

Disucz's method of modifying the number of post views·····Refresh once and increase it to N

WBOY
WBOYOriginal
2016-07-25 09:13:461588browse
Open: Under sourcemoduleforum, open forum_viewthread.php and find
  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' => < ;b>1), false, true);
  7. }
  8. } else {
  9. C::t('forum_thread') ->increase($_G['tid'], array('views' =>1), true, $tableid);
Copy the code
Change the three 1's in the above code to N (the value you want)

For example:
  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);
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn