/i","..." />
 手机
当前位置:查字典教程网 >CMS教程 >phpcms >PHPCMS v9过滤采集内容中CSS样式的实现方法
PHPCMS v9过滤采集内容中CSS样式的实现方法
摘要:方法如下:1、找到phpcmslibsfunctionsglobal.func.php打开,然后添加函数functionhtmrp($str...

方法如下:

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中实现网站变成黑白的方法代码

PHPCMS V9用array_unique函数解决采集网址重复的办法

phpcms 读不到缓存 页面空白的解决方法

Phpcms V9 调用随机文章的实现方法

让PHPCms内容页支持JavaScript的修改方法

PHPCMS V9专题模块注入漏洞的分析与修复方法

phpcms v9中调用发布时间的方法

phpcms v9忘记管理员后台密码的解决方法

phpcms V9修改lists标签(实现调用文章所属栏目及点击数)

修改phpcms v9后台登录地址的方法

精品推荐
分类导航