雷火电竞-中国电竞赛事及体育赛事平台

歡迎來到入門教程網(wǎng)!

phpcms

當前位置:主頁 > CMS教程 > phpcms >

PHPCMS v9過濾采集內(nèi)容中CSS樣式的實現(xiàn)方法

來源:本站原創(chuàng)|時間:2020-01-10|欄目:phpcms|點擊:

方法如下:

  1、找到\phpcms\libs\functions\global.func.php 打開,然后添加函數(shù)


復制代碼
代碼如下:

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、修改當前模板中文章內(nèi)容頁模板show.html

  界面—模板風格—詳情列表—content—show.html

  找到

{if $allow_visitor==1}
     {$content}

  修改為

復制代碼
代碼如下:

{if $allow_visitor==1}
{htmrp($content)}

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

上一篇:phpcms2008后臺文章發(fā)布文本輸入框長度設置方法

欄    目:phpcms

下一篇:完美整合phpcms v9和discuz X3.1實現(xiàn)同步登陸退出論壇免激活

本文標題:PHPCMS v9過濾采集內(nèi)容中CSS樣式的實現(xiàn)方法

本文地址:http://www.jygsgssxh.com/a1/phpcms/9850.html

網(wǎng)頁制作CMS教程網(wǎng)絡編程軟件編程腳本語言數(shù)據(jù)庫服務器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導致的法律后果,本站均不負任何責任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有