-
天花板循环扇类网站织梦...
-
货物运输汽车贸易类网站...
-
房屋建造设计类网站织梦...
-
网站建设开发类网站织梦...
-
智能家居类网站织梦模板...
-
短视频直播带货类网站织...
-
投资财富管理类网站织梦...
-
艺考培训类网站织梦模板...
-
建筑智能研发系统类网站...
-
医疗机构类网站织梦模板...
-
恋爱情感资讯类网站织梦...
-
全自动环保污水处理设备...
-
QQ个性空间日志资讯类网...
-
税务筹划公司登记代理网...
-
茶几茶盘类网站织梦模板...
-
五谷杂粮米业类网站织梦...
-
餐饮服务管理类网站织梦...
-
品牌设计建设类网站织梦...
-
新闻博客类网站织梦模板...
-
建筑规划施工类网站织梦...
大部分手机站都是自适应的,这样图片就不能有宽高限制,我们添加文章图片时很多时候都会有width height style这些属性在里面,在手机站上要把它们清除并且让图片和附件都使用上绝对路径,又不能影响电脑站的,不修改程序内核文件,我们可以在手机版内容页模板里,
把手机站内容页模板把调用文章内容的标签,找到
{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}
如果是栏目内容的图片要自适应的话那标签
{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}


