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


本文整理自网络,侵删。

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


标签:织梦DedeCMS

相关阅读 >>

dede整合资料 注册部分脚本 可独立使用

dedecms全版本通杀sql注入漏洞利用代码及工具2014年2月28日

dedecms织梦模板栏目列表中添加统计文档数量的标签

dedecms织梦tag标签静态生成html,url拼音及分页优化的方法

超高级dedecms采集,自动生成原创文章原理

dedecms v5.7提示php.ini register_globals must is off错误的解决方法

dedecms系统自定义字段图片调用问题的解决方法

重新安装织梦系统以及转移空间、上传空间的方法

dedecms5.7首页和列表页模板中动态调用文章浏览次数的方法

织梦dedev5.6中的跨站漏洞的修复实例方法

更多相关阅读请进入《织梦DedeCMS》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...