-
車輛機油工業(yè)潤滑油類網(wǎng)...
-
企業(yè)公司行業(yè)通用類網(wǎng)站...
-
潮流資訊信息類網(wǎng)站織夢...
-
辦公學(xué)習(xí)教程資訊類網(wǎng)站...
-
園林綠化景觀建設(shè)類網(wǎng)站...
-
農(nóng)業(yè)機械設(shè)備類網(wǎng)站織夢...
-
中藥藥材百科資訊類網(wǎng)站...
-
汽車配件類網(wǎng)站織夢模板...
-
灶具電器設(shè)備類網(wǎng)站織夢...
-
APP應(yīng)用程序官網(wǎng)類網(wǎng)站織...
-
園林景觀設(shè)計類網(wǎng)站織夢...
-
環(huán)保設(shè)備研發(fā)制造類網(wǎng)站...
-
新媒體自媒體運營資訊類...
-
網(wǎng)站建設(shè)營銷類網(wǎng)站織夢...
-
LED顯示屏中英雙外貿(mào)類網(wǎng)...
-
道路護欄交通設(shè)施類網(wǎng)站...
-
環(huán)保電動掃地車類網(wǎng)站織...
-
水上樂園設(shè)備類網(wǎng)站織夢...
-
攝影拍攝短視頻類網(wǎng)站織...
-
水性工業(yè)漆類企業(yè)網(wǎng)站織...
大部分手機站都是自適應(yīng)的,這樣圖片就不能有寬高限制,我們添加文章圖片時很多時候都會有width height style這些屬性在里面,在手機站上要把它們清除并且讓圖片和附件都使用上絕對路徑,又不能影響電腦站的,不修改程序內(nèi)核文件,我們可以在手機版內(nèi)容頁模板里,
把手機站內(nèi)容頁模板把調(diào)用文章內(nèi)容的標簽,找到
{dede:field.body/}
改成
{dede:field.body runphp=yes}global $cfg_basehost;$str = @me;$search = '/(<img.*?)width=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is';$search1 = '/(<img.*?)height=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is';$search2 = '#(<img.*?style=".*?)width:\s{0,}\d+px;([^"]*?.*?>)#i';$search3 = '#(<img.*?style=".*?)height:\s{0,}\d+px;([^"]*?.*?>)#i';$content = preg_replace($search,'$1$3',$str);$content = preg_replace($search1,'$1$3',$content);$content = preg_replace($search2,'$1$2',$content);$content = preg_replace($search3,'$1$2',$content);@me = str_replace('/uploads/', $cfg_basehost.'/uploads/', $content);{/dede:field.body}
如果是欄目內(nèi)容的圖片要自適應(yīng)的話那標簽
{dede:field.content/}
改成
{dede:field.content runphp=yes}global $cfg_basehost;$str = @me;$search = '/(<img.*?)width=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is';$search1 = '/(<img.*?)height=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is';$search2 = '#(<img.*?style=".*?)width:\s{0,}\d+px;([^"]*?.*?>)#i';$search3 = '#(<img.*?style=".*?)height:\s{0,}\d+px;([^"]*?.*?>)#i';$content = preg_replace($search,'$1$3',$str);$content = preg_replace($search1,'$1$3',$content);$content = preg_replace($search2,'$1$2',$content);$content = preg_replace($search3,'$1$2',$content);@me = str_replace('/uploads/', $cfg_basehost.'/uploads/', $content);{/dede:field.content}




