打开 万能文章系统/admin/gather.php 文件
查找到
//过滤文章中不想看到的文字
if($rsdb[show_replace_word]){
$detail=explode("\r\n",$rsdb[show_replace_word]);
foreach($detail AS $key=>$value){
list($oldword,$newword)=explode("|",$value);
$show_content=str_replace($oldword,$newword,$show_content);
}
}
在这段代码的 下面添加如下代码。
//文章内容自动过滤开始
$search = array ("'<script[^>]*?>.*?</script>'si",//过滤SCRIPT标记
"'<iframe[^>]*?>.*?</iframe>'si", //过滤IFRAME标记
"'<style[^>]*?>.*?</style>'si",//过滤STYLE标记
"'<[\/\!]*span[^<>]*?>'si",//过滤SPAN标记
"'<[\/\!]*font[^<>]*?>'si",//过滤FONT标记
"'<[\/\!]*a[^<>]*?>'si",//过滤A标记,如果要过滤链接中的字,必须在过滤规则中写下。
"'<[\/\!]*div[^<>]*?>'si",//过滤DIV标记
"'<[\/\!]*table[^<>]*?>'si",//过滤TABLE标记
"'<[\/\!]*tbody[^<>]*?>'si",//过滤TBODY标记
"'<[\/\!]*th[^<>]*?>'si",//过滤TH标记
"'<[\/\!]*tr[^<>]*?>'si",//过滤TR标记
"'<[\/\!]*td[^<>]*?>'si",//过滤TD标记
"'<[\/\!]*p[^<>]*?>'si",//过滤P标记
"'<[\/\!]*o:p[^<>]*?>'si",//过滤o:p标记
"'<[\?\!]*xml:[^<>]*?>'si",//过滤xml:标记
"'<[\/\!]*select[^<>]*?>'si",//过滤select标记
"'<[\/\!]*option[^<>]*?>'si",//过滤option标记
"'<[\/\!]*v:[^<>]*?>'si",//过滤v:标记
"'<[\/\!]*o:[^<>]*?>'si",//过滤o:标记
"'onclick=([^\s>]*)|onchange=([^\s>]*)|onselect=([^\s>]*)|onfocus=([^\s>]*)|onblur=([^\s>]*)|onunload=([^\s>]*)|onland=([^\s>]*)|onerror=([^\s>]*)|onmouseover=([^\s>]*)|onmouseout=([^\s>]*)|id=([^\s>]*)|class=([^\s>]*)|name=([^\s>]*)|align=([^\s>]*)|cellpadding=([^\s>]*)|cellspacing=([^\s>]*)|border=([^\s>]*)|bordercolor=([^\s>]*)|background=([^\s>]*)|bgcolor=([^\s>]*)'si",
"'(\d+);'e");
$replace = array ("",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"chr(\\1)");
$show_content=preg_replace($search,$replace,$show_content);
$show_content=preg_replace("/style=['\"]*([^'\"]*)['\"]*/is","",$show_content);//过虑style
$show_content=str_replace("\r\n","",$show_content); //去除HTML中的换行符
使用注意:
1。以上被过虑的代码都会被自动过虑掉。在后台内容采集的时候,不需要再重复填写。
2。以上过虑是不区分大小写的
3。若想保留段落标记,若在后台内容采集的时候,填写替换 如</p>|<br />