冠富商务通中文社区

标题: 【 phpcmsv9采集教程】-PHPCMS v9过滤采集内容中CSS样式的实现方法 [打印本页]

作者: admin    时间: 2017-10-29 03:34
标题: 【 phpcmsv9采集教程】-PHPCMS v9过滤采集内容中CSS样式的实现方法
方法如下:
  1、找到\phpcms\libs\functions\global.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
  界面模板风格详情列表contentshow.html
  找到
{if $allow_visitor==1}
{$content}

  修改为

复制代码代码如下:
{if $allow_visitor==1}
{htmrp($content)}

  3、更新缓存,刷新即可。




欢迎光临 冠富商务通中文社区 (http://gu1vhwx.nat.ipyingshe.com/news/) Powered by Discuz! 3.0