How to Replace Post content in batches in Discuz (use SQL to update database) _ PHP Tutorial

Source: Internet
Author: User
How to replace the post content in batches by Discuz (use SQL to update the database ). Today, a friend's DiscuzX2 forum needs to replace the content of posts in batches. There are tens of thousands of posts. in the beginning, words are filtered and no effect is found, you can only use the database to replace the content of a friend's Discuz X2 Forum in batches. the number of posts is tens of thousands. in the beginning, you can set word filtering to find that there is no effect, you can only replace the database in batches. For more information, see.

The Discuz X2 Forum provides the Database SQL statement operation function in the background. However, this function is disabled by default for security reasons. you must modify the configuration file as follows:

Find the Forum program file config/config_global.php, open the file in notepad, and find $ _ config ['security'] ['querysafe '] ['status'] to set it to 0, continue to search for $ _ config ['admincp'] ['runquery'] and set it to 1. (For security reasons, we recommend that you change the values of these two parameters after the SQL statement is executed)

The following describes how to modify the content of Discuz X2 in batches:

1. go to the Discuz X2 backend → webmaster → database → upgrade

2. enter the following statement and submit it:

The code is as follows:


UPDATE pre_forum_post SET message = REPLACE (message, "" content to be replaced "", "" new content "");

Forum X2 needs to replace the content of posts in batches. the number of posts is tens of thousands. in the beginning, words are filtered and no effect is found. you can only replace the content in batches in the database...

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.