织梦DeDeCms5.6图集中图片ALT自动提取标题的修改方法

织梦5.6的图集图片ALT默认是提取注释的,需要手动添加,比较懒,不想手动添加的,那么请使用下面的方法,就能实现图集图片ALT自动提取标题

1、查找文件:include/arc.archives.class.php

2、查找(209位置)

  1. //设置全局环境变量   
  2. $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];   
  3. @SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives');   
  4. }   
  5. //完成附加表信息读取   
  6. unset($row);   
  7. 在 @SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives'); 

3、加入下面代码

  1. //替换图片描述为标题   
  2. $this->Fields['body'] = str_ireplace("<img " ,  
  3. "<img alt='".$this->Fields['title'].",手机壁纸下载(www.plbz.net)",$this->Fields['body']);   
  4. $this->Fields['imgurls'] = str_ireplace("<img " ,  
  5. "<img alt='".$this->Fields['title'].",手机壁纸下载(www.plbz.net)",$this->Fields['imgurls']);   
  6. $this->Fields['introduce'] = str_ireplace("<img " ,  
  7. "<img alt='".$this->Fields['title'].",手机壁纸下载(www.plbz.net)",$this->Fields['introduce']); 

演示:

织梦DeDeCms5.6图集中图片ALT自动提取标题的修改方法

手机壁纸:http://www.plbz.net/

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!
本文关键词:

联系我们

在线咨询:点击这里给我发消息

邮件:w420220301@qq.com