方法如下:
1、找到phpcmslibsfunctionsglobal.func.php 打开,然后添加函数
function htmrp($str) {
$str = preg_replace("/<script[^>]*>/i", "", $str);
$str = preg_replace("/</script>/i", "", $str);
$str = preg_replace("/<iframe[^>]*>/i", "", $str);
$str = preg_replace("/</iframe>/i", "", $str);
$str = preg_replace("/<style[^>]*>/i", "", $str);
$str = preg_replace("/</style>/i", "", $str);
$str = preg_replace("/<div[^>]*>/i", "", $str);
$str = preg_replace("/</div>/i", "", $str);
return $str;
}
2、修改当前模板中文章内容页模板show.html
界面—模板风格—详情列表—content—show.html
找到
{if $allow_visitor==1}
{$content}
修改为
{if $allow_visitor==1}
{htmrp($content)}
3、更新缓存,刷新即可。
【PHPCMS v9过滤采集内容中CSS样式的实现方法】相关文章:
★ PHPCMS通过getJSON调用的地址回调函数一直无法执行
★ PHPCMS V9采集过滤选项遗留下换行 回车 空格的解决办法
★ phpcms 列表页中调用其下的所有子栏目(或特定的子栏目)的方法
★ Phpcms V9 管理后台登陆及会员注册登录模板的修改方法
★ PHPCMS开启全文搜索(sphinx)后搜索无效的解决方法