zoukankan      html  css  js  c++  java
  • Dedecms sql命令批量修改内容

    今天要修改一个网站的栏目命名方法,因为网站的文章数目太多了,为了方便管理和优化把栏目尽量的扁平化简单化,就要修改dedecms生成页面的命名方法,100多个栏目一个一个改要改多久啊,就从网上找了一个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://iXinFly.com/img/','src="http://iXinFly.com/images/');

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    update dede_archives set source=replace(source,'心飞扬网络www.iXinFly.com','心飞扬网络iXinFly.com');

    例子解释:把文章模型中的帖子来源由原来的心飞扬网络www.iXinFly.com替换成心飞扬网络iXinFly.com

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

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

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

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

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

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

    11.批量审核文章

    update dede_archives set arcrank=0;
    update dede_arctiny set arcrank=0;
    update dede_taglist set arcrank=0;

    例子解释:arcrank=0 仅动态

  • 相关阅读:
    一行转多行 及多行转一行的 hive语句
    sparkSQL、dataframe
    特征工程
    python相关
    pyspark dataframe 格式数据输入 做逻辑回归
    hive sql 随机抽样
    pyspark 逻辑回归程序
    3.27模拟赛
    luogu P3217 [HNOI2011]数矩形
    bzoj 4403 序列统计
  • 原文地址:https://www.cnblogs.com/xrhui/p/4513580.html
Copyright © 2011-2022 走看看