这篇文章主要介绍了织梦cms添加软件时关键字自动从TAG标签获取方法,我们建站的时候忽略了软件频道关键字不能自动从TAG中获取,而是从标题中分解出一些毫无意义的关键字,导致调用“相关文章”时文章不相关......
如何为dedecms织梦模板发布文章添加禁用词语过滤功能
来源:互联网
2023-03-14 12:47:26 360
dedecms(本例为V57_UTF8_SP1)中在互动部分有词语过滤功能,但是文章部分没有添加此功能,我们自己手动添加下发布文章禁用词语过滤功能。
在/dede/article_add.php中的代码:
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')) { $arcrank = -1; }之前添加代码:
//词汇过滤检查 if( $cfg_notallowstr != '' ) { if(preg_match("#".$cfg_notallowstr."#i", $title)) { ShowMsg("title has not allow words!","-1"); exit(); } if(preg_match("#".$cfg_notallowstr."#i", $shorttitle)) { ShowMsg("shorttitle has not allow words!!","-1"); exit(); } if(preg_match("#".$cfg_notallowstr."#i", $description)) { ShowMsg("description has not allow words!","-1"); exit(); } if(preg_match("#".$cfg_notallowstr."#i", $body)) { ShowMsg("body has not allow words!","-1"); exit(); } }同时修改/dede/article_edit.php中对应代码部分就可以了。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持办公区教程网。
以上方法由办公区教程网编辑摘抄整理自互联网可供大家参考!
相关文章