-
玩具動漫類網(wǎng)站織夢模板...
-
儀器儀表科技公司類網(wǎng)站...
-
蔬菜鮮果配送類網(wǎng)站織夢...
-
手游APP軟件下載類網(wǎng)站織...
-
精工機(jī)械軸承生產(chǎn)廠家類...
-
網(wǎng)站模板資源下載類網(wǎng)站...
-
裝飾建材公司類網(wǎng)站織夢...
-
食品百貨英文外貿(mào)類網(wǎng)站...
-
儀器分析儀類網(wǎng)站織夢模...
-
鋼結(jié)構(gòu)崗?fù)I銷型織夢網(wǎng)...
-
人力資源管理類網(wǎng)站織夢...
-
營銷型無縫鋼管定制生產(chǎn)...
-
中英雙語律師事務(wù)所類網(wǎng)...
-
財稅記賬工商注冊認(rèn)證類...
-
物流快運速遞類網(wǎng)站織夢...
-
水利工程施工類網(wǎng)站織夢...
-
電腦系統(tǒng)軟件下載類網(wǎng)站...
-
貂絨大衣服裝設(shè)計類網(wǎng)站...
-
展覽展會信息類網(wǎng)站織夢...
-
電子元件電路板類網(wǎng)站織...
大部分手機(jī)站都是自適應(yīng)的,這樣圖片就不能有寬高限制,我們添加文章圖片時很多時候都會有width height style這些屬性在里面,在手機(jī)站上要把它們清除并且讓圖片和附件都使用上絕對路徑,又不能影響電腦站的,不修改程序內(nèi)核文件,我們可以在手機(jī)版內(nèi)容頁模板里,
把手機(jī)站內(nèi)容頁模板把調(diào)用文章內(nèi)容的標(biāo)簽,找到
{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)的話那標(biāo)簽
{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}