dedecms(本例為V57_UTF8_SP1)中在互動(dòng)部分有詞語過濾功能,但是文章部分沒有添加此功能,我們自己手動(dòng)添加下發(fā)布文章禁用詞語過濾功能。
在/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(); } }
同時(shí)修改/dede/article_edit.php中對(duì)應(yīng)代碼部分就可以了。文章來源:http://www.zghlxwxcb.cn/news/detail-433116.html
以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持yii666。文章來源地址http://www.zghlxwxcb.cn/news/detail-433116.html
到了這里,關(guān)于如何為dedecms織夢模板發(fā)布文章添加禁用詞語過濾功能的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!