找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 272|回复: 0

[cms教程] 为dedecms织梦模板发布文章添加禁用词语过滤功能

[复制链接]

该用户从未签到

发表于 2021-6-7 10:37:19 | 显示全部楼层 |阅读模式

您需要 登录 才可以下载或查看,没有账号?立即注册

×
   
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中对应代码部分就可以了。...

   
内容已隐藏,请关注公众号输入验证码查看

               
验证码 

  

本帖支持关注公众号查看

【无套路  无套路  无套路 扫描二维码关注公众号发送【验证码】收到验证码 在上面输入点击提交查看即可显示隐藏内容】

回复

使用道具 举报

网站地图|页面地图|Archiver|手机版|小黑屋|找资源 |网站地图

GMT+8, 2025-5-2 17:37

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表