PHPCMS v9过滤采集内容中CSS样式的实现方法
<p>方法如下:</p>
<p>
1、找到\phpcms\libs\functions\global.func.php 打开,然后添加函数</p>
<p>
</p>
<div>
<p>
代码如下:</p>
</div>
<div id="phpcode2">
<br>
function htmrp($str) {<br>
$str = preg_replace("/<script[^>]*>/i", "", $str); <br>
$str = preg_replace("/<\/script>/i", "", $str);<br>
$str = preg_replace("/<iframe[^>]*>/i", "", $str); <br>
$str = preg_replace("/<\/iframe>/i", "", $str); <br>
$str = preg_replace("/<style[^>]*>/i", "", $str); <br>
$str = preg_replace("/<\/style>/i", "", $str); <br>
$str = preg_replace("/<div[^>]*>/i", "", $str); <br>
$str = preg_replace("/<\/div>/i", "", $str);<br>
return $str;<br>
}</div>
<p>
</p>
<p>
2、修改当前模板中文章内容页模板show.html</p>
<p>
界面—模板风格—详情列表—content—show.html</p>
<p>
找到</p>
<p>
{if $allow_visitor==1}<br>
{$content}<br><br>
修改为<br>
</p>
<div>
<p>
代码如下:</p>
</div>
<div id="phpcode3">
<br>
{if $allow_visitor==1}<br>
{htmrp($content)}</div>
<p>
</p>
<p>
3、更新缓存,刷新即可。</p>
頁:
[1]