如何取消dedecms发布文章时文章自动生关键字

http://www.itjxue.com  2015-06-24 13:28  来源:IT教学网  点击次数: 

有些同学告诉我说dedecms发布文章的时候,如果不设置关键词,他会自动抓取文章中一些关键词出来,但是抓取的又不太好,那么我们今天来看看这个怎么不让他抓取关键词

在织梦根目录下dede(默认后台)文件夹里找到article_add.php
 
在190行附近找到一下代码。。。。
 
以下是代码片段:
$query = "INSERT INTO `dede_archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,
    color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywords,filename,dutyadmin,weight)
    VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money',
    '$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate',
    '$adminid','$voteid','$notpost','$description','$keywords','$filename','$adminid','$weight');";
修改为
 
以下是代码片段:
if($keysords!=''){
    $query = "INSERT INTO `dede_archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,
    color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywords,filename,dutyadmin,weight)
    VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money',
    '$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate',
    '$adminid','$voteid','$notpost','$description','$keywords','$filename','$adminid','$weight');";
    }else{
        $query = "INSERT INTO `dede_archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,
    color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,filename,dutyadmin,weight)
    VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money',
    '$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate',
    '$adminid','$voteid','$notpost','$description','$filename','$adminid','$weight');";
    }
 
 其实很简单。判断一下keywords是否为空就可以了
小提示:记得修改前要备份哦!

(责任编辑:IT教学网)

更多