-
财富管理培训咨询类网站...
-
产品展示柜台类网站织梦...
-
中英双语窗帘门窗设计类...
-
防腐木材工程类网站织梦...
-
装修设计类网站织梦模板...
-
QQ个性空间日志资讯类网...
-
家政服务保姆月嫂类网站...
-
网站建设万词霸屏SEO优化...
-
仪器仪表科技公司类网站...
-
智能电子玩具类网站织梦...
-
仪器分析仪类网站织梦模...
-
精工机械轴承加工类网站...
-
财经新闻资讯网类织梦模...
-
搬家搬迁公司类网站织梦...
-
物流快运速递类网站织梦...
-
网络品牌广告设计类网站...
-
茶几茶盘类网站织梦模板...
-
新闻博客资讯类网站织梦...
-
鲜花商城购物类网站织梦...
-
汽车用品配件类网站织梦...
不用修改程序内核文件,不影响电脑站和手机站文章内容页的文章内容输出,增加个自定义方法来解决织梦MIP文章内容页图片适配百度MIP规范
- 操作步骤
- <img 替换成 <mip-img
- width|height 去除图片宽高
- style 去除内联样式
- /uploads/ 相对路径图片路径替换成绝对路径
打开 /include/extend.func.php 在最下面加入个方法
/*** MIP文章内容页图片适配百度MIP规范** @access public* @param string $content 文章内容* @return string*/function mip($content){global $cfg_basehost;preg_match_all('/<img (.*?)\>/', $content, $images);if(!is_null($images)) {foreach($images[1] as $index => $value){$mip_img = str_replace('<img', '<mip-img', $images[0][$index]);$mip_img = str_replace('>', '></mip-img>', $mip_img);$mip_img = preg_replace('/(width|height)="\d*"\s/', '', $mip_img );$mip_img = preg_replace('/ style=\".*?\"/', '',$mip_img);$content = str_replace($images[0][$index], $mip_img, $content);}}preg_match_all('/ style=\".*?\"/', $content, $style);if(!is_null($style)) {foreach($style[0] as $index => $value){$mip_style = preg_replace('/ style=\".*?\"/', '',$style[0][$index]);$content = str_replace($style[0][$index], $mip_style, $content);}}$content = str_replace('/uploads/', $cfg_basehost.'/uploads/', $content);return $content;}
内容页模板标签写法
{dede:field.body function=mip(@me)/}


