如何为dedecms织梦模板发布文章添加禁用词语过滤功能

如何为dedecms织梦模板发布文章添加禁用词语过滤功能,第1张

如何为dedecms织梦模板发布文章添加禁用词语过滤功能

本文详细介绍了如何在dedecmsDreamweaver网站模板发布的文章中添加禁止使用文字过滤功能的相关信息。边肖感觉挺好的,现在分享给大家,给大家一个参考。和边肖一起回来。

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("titlehasnotallowwords!","-1"); exit(); } if(preg_match("#".$cfg_notallowstr."#i",$shorttitle)) { ShowMsg("shorttitlehasnotallowwords!!","-1"); exit(); } if(preg_match("#".$cfg_notallowstr."#i",$description)) { ShowMsg("descriptionhasnotallowwords!","-1"); exit(); } if(preg_match("#".$cfg_notallowstr."#i",$body)) { ShowMsg("bodyhasnotallowwords!","-1"); exit(); } }

另外,在/dede/dede/article_edit.php中修改一部分匹配代码就够了

文章里的内容就这些了。期待对大家的学习和培训有所帮助,也期待大家的应用。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zz/772054.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-03
下一篇2022-05-03

发表评论

登录后才能评论

评论列表(0条)

    保存