Home  >  Article  >  CMS Tutorial  >  How to modify the keyword length in Dede

How to modify the keyword length in Dede

藏色散人
藏色散人Original
2019-12-10 10:04:102311browse

How to modify the keyword length in Dede

织梦dede怎么修改关键字长度?

在网站的制作中,很多时候dede默认的一些设置可能无法达到我们要求,就如dede关键字长度一样,无法达到我们的要求,如果想修改到我们所需要的长度的话,需要修改一些php文件及数据库

推荐学习:织梦cms

  

dede文件修改默认关键字长度

第1步:找到并打开dede后台目录下的article_edit.php和article_add.php文件。

电脑维修技术网注:如果是修改专题认关键字的话,需要修改spec_add.php和spec_edit.php文件。

第2步:在文件中搜索"keywords",找到“$keywords = trim(cn_substrR($keywords, 60));”这行代码,修改为$keywords = $keywords;并保存。

数据库关键字默认长度修改

默认dede的keywords关键字数据库类型为char长度也只有20,所以我们需要把这个数据库字段类型改成varchar长度也改成200.

第1步:成功登录到dede后台,或是使用工具软件什么的连接到mysql数据库。

第2步:找到dede数据库,执行以下代码。

代码如下:

ALTER TABLE dede_archives MODIFY COLUMN keywords VARCHAR(200); 
以上SQL语句说明,dede_archives为dede表名。keywords为需要修改的字段名。
ALTER TABLE 表名 MODIFY COLUMN 字段名 数据类型;

The above is the detailed content of How to modify the keyword length in Dede. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn