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
Release: 2016-07-25 09:13:46
Original
1565 people have browsed it
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


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template