discuz! Tutorial How to modify the theme views with a simple PHP file implementation?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.