This article explains how to modify the theme views with a simple PHP file.
Many stationmaster needs to be able to modify the topic's view quantity under certain special needs, but does not know how to operate, this article introduces one kind of method which modifies the topic view quantity through a simple file;
Create a file, such as: threadviews.php
Write the following code
<!--? phpdefine (' Apptypeid ', 127); Define (' Curscript ', ' threadviews '); Require './source/class/class_core.php '; $discuz = & Discuz_core::instance (), $discuz--->cachelist = $cachelist; $discuz->init ();
Here is the post you want to edit tid, change to the one you want to change
$tid = 123;
Here are the target views to modify
$views = 999; Db::update (' Forum_thread ', Array (' views ' = = $views), array (' tid ' = = $tid)); C::t (' Forum_thread ')->clear_cache ($tid), echo ' OK ';? >
Then upload the threadtime.php to your forum root directory (that is, the same directory as forum.php, home.php)!
Open the URL in the browser:/HTTP/your domain/threadviews.php
See the page output OK, the modification is successful!
The above code can be implemented once to modify the number of views of a topic, if you need to be able to batch modification, can be achieved by means of plug-ins, discuz! Application Center has the ability to bulk modify the number of plug-ins.
This article describes how to modify the theme views through a simple PHP file, more relevant content please follow the PHP Chinese web.