【实测】如何批量替换DZ帖子标题,DZ帖子内容,DZ文章标题,DZ文章内容-Discuz教程下载

【实测】如何批量替换DZ帖子标题,DZ帖子内容,DZ文章标题,DZ文章内容

开通本站Svip会员,全站资源免费下
方法:
进入dz后台:站长数据库 – 升级

默认情况下出于安全考虑,该功能是被关闭的,所以得先修改下配置文件,方法如下:

找到论坛程序文件config/config_global.php,用记事本打开该文件,然后查找$_config['security']['querysafe']['status']将其设置为0,继续查找$_config['admincp']['runquery']将其设置为1即可。
(出于安全考虑,建议执行SQL语句完毕后将这两个参数的值再改回来)

批量替换门户文章标题:
亲爱的游客您好,请 登录 后进行 回复
批量替换门户文章内容:
亲爱的游客您好,请 登录 后进行 回复
批量替换门户文章摘要:
亲爱的游客您好,请 登录 后进行 回复
批量替换论坛贴子标题:
亲爱的游客您好,请 登录 后进行 回复
批量替换论坛贴子内容:
亲爱的游客您好,请 登录 后进行 回复
批量替换贴子分类信息内容:批量替换门户专题标题:
亲爱的游客您好,请 登录 后进行 回复
批量替换门户专题SEO描述
亲爱的游客您好,请 登录 后进行 回复
批量替换门户专题SEO关键字
亲爱的游客您好,请 登录 后进行 回复
论坛附件转换为远程附件(where remote=0表示本地,where remote=1表示远程, pre_表示数据库表前缀)
  1. update pre_forum_attachment_0 set remote=1 where remote=0;
  2. update pre_forum_attachment_1 set remote=1 where remote=0;
  3. update pre_forum_attachment_2 set remote=1 where remote=0;
  4. update pre_forum_attachment_3 set remote=1 where remote=0;
  5. update pre_forum_attachment_4 set remote=1 where remote=0;
  6. update pre_forum_attachment_5 set remote=1 where remote=0;
  7. update pre_forum_attachment_6 set remote=1 where remote=0;
  8. update pre_forum_attachment_7 set remote=1 where remote=0;
  9. update pre_forum_attachment_8 set remote=1 where remote=0;
  10. update pre_forum_attachment_9 set remote=1 where remote=0;
复制代码
门户附件转换为远程附件
  1. update pre_portal_article_title set remote=1 where remote=0;
  2. update pre_portal_attachment set remote=1 where remote=0;
  3. update pre_portal_topic_pic set remote=1 where remote=0;
复制代码
相册附件转换为远程附件{相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)}
  1. update pre_home_pic set remote=remote+1;
复制代码
远程附件转到本地附件
执行此操作前请务必登陆Discuz论坛管理后台关闭远程附件设置,并将附件移动到本地服务器的 data/attachment目录后方可执行以下SQL语句。
(where remote=0表示本地,where remote=1表示远程, pre_表示数据库表前缀)
  1. update pre_forum_attachment_0 set remote=0 where remote=1;
  2. update pre_forum_attachment_1 set remote=0 where remote=1;
  3. update pre_forum_attachment_2 set remote=0 where remote=1;
  4. update pre_forum_attachment_3 set remote=0 where remote=1;
  5. update pre_forum_attachment_4 set remote=0 where remote=1;
  6. update pre_forum_attachment_5 set remote=0 where remote=1;
  7. update pre_forum_attachment_6 set remote=0 where remote=1;
  8. update pre_forum_attachment_7 set remote=0 where remote=1;
  9. update pre_forum_attachment_8 set remote=0 where remote=1;
  10. update pre_forum_attachment_9 set remote=0 where remote=1;
  11. update pre_portal_article_title set remote=0 where remote=1;
  12. update pre_portal_attachment set remote=0 where remote=1;
  13. update pre_portal_topic_pic set remote=0 where remote=1;
  14. update pre_home_pic set remote=remote-1;
复制代码

举例:
亲爱的游客您好,请 登录 后进行 回复



全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部