Dedecms sql命令批量修改内容

织梦教程 强烈建议 2024-02-26 11:05 146 0

  今天要修改一个网站的栏目命名方法,因为网站的文章数目太多了,为了方便管理和优化把栏目尽量的扁平化简单化,就要修改dedecms生成页面的命名方法,100多个栏目一个一个改要改多久啊,TC就从网上找了一个sql批量修改命名的方法,随便也把其他dedecms sql命名方法也发上来:

  select namerule from dede_arctype

  select namerule2 from dede_arctype

  update dede_arctype set namerule='{typedir}/{aid}.html'

  update dede_arctype set namerule2='{typedir}/list_{page}.html'

  利用SQL命令批量修改内容,路径和超链接等信息。

  语句 DEDECMS SQL命令批量替换

  1.更改文章中的内容

  update dede_addonarticle set body=replace(body,'原来的字符','替换后的字符')

  例子解释:update dede_addonarticle set body=replace(body,’软件下载’,'插件下载’)

  2.更改缩略图目录

  update dede_archives set litpic=replace(litpic,'原来的字符','替换后的字符')

  例子解释:update dede_archives set litpic=replace(litpic,’uplimg,’tupian’)

  3.批量替换文章模型中内容部分图片链接路径.

  update dede_addonarticle set body=replace(body,'src="http://20tc.com/img/','src="http://20tc.com/images/');

  例子解释:把图片路径由原来的http://www.20tc.com/img/替换成http://20tc.com/images/

  4.批量替换文章模型中内容部分超链接

  update dede_addonarticle set body=replace(body,'href="http://www.meiowpet.com','href="http://meiowpet.com');

  例子解释:把文章模型中的超链接由原来的http://www.20tc.com替换成http://20tc.com

  5.批量替换文章模型中内容部分图片锚文本文字

  update dede_addonarticle set body=replace(body,'http://20tc.com/');

  例子解释:把文章模型中的图片锚文本信息由原来的http://www.20tc.com替换成http://20tc.com

  6.批量替换软件模型内容部分超链接

  update dede_addonsoft set introduce=replace(introduce,'href="http://www.meowpetcom/images/js/test.html','href="http:/20tc.com/index.html');

  例子解释:把软件模型内容中超链接由原来的http://www.20tc.com/images/js/test.html替换成http:/20tc.com/index.htm

  7.批量替换文章模型中作者字段

  update dede_archives set writer=replace(writer,'http://www.20tc.com','http://20tc.com');

  例子解释:把文章模型中的作者由原来的http://www.20tc.com替换成http://20tc.com

  8.批量替换文章模型中来源字段

  update dede_archives set source=replace(source,'似水星辰www.20tc.com','星辰似水20tc.com');

  例子解释:把文章模型中的帖子来源由原来的似水星辰www.20tc.com替换成星辰似水20tc.com

  9.批量替换文章命名规则

  update `dede_arctype` set namerule='{typedir}/{aid}.html';

  例子解释:把站内所有文章模型命名规则全部替换成{typedir}/{aid}.html这样一种形式

  10.批量替换软件模型演示地址超链接

  update dede_addonsoft set writer=replace(officialUrl,'http:/www.20tc.com','http://20tc.com');

  例子解释:把软件模型原始地址超链接由原来的http:/www.20tc.com替换成http://20tc.com

  11.批量审核文章

  update dede_archives set arcrank=0;

  update dede_arctiny set arcrank=0;

  update dede_taglist set arcrank=0;

本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!