今天一个朋友的Discuz X2论坛需要批量替换帖子的内容,帖子数量上万,一开始是通过设置词语过滤,发现无效果,只能通过数据库批量替换了,具体方法请接着往下看。
Discuz X2论坛后台提供数据库SQL语句操作的功能,但是默认情况下出于安全考虑,该功能是被关闭的,所以得先修改下配置文件,方法如下:
找到论坛程序文件config/config_global.php,用记事本打开该文件,然后查找$_config['security']['querysafe']['status']将其设置为0,继续查找$_config['admincp']['runquery']将其设置为1即可。(出于安全考虑,建议执行SQL语句完毕后将这两个参数的值再改回来)
下面教大家Discuz X2批量修改帖子内容的方法:
1.进入Discuz X2后台→站长→数据库→升级
2.输入如下语句后提交即可:
复制代码 代码如下:
UPDATE pre_forum_post SET message=REPLACE(message,""要替换的内容"",""新内容"");

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment