织梦5.6的图集图片ALT默认是提取注释的,需要手动添加,比较懒,不想手动添加的,那么请使用下面的方法,就能实现图集图片ALT自动提取标题。
1、查找文件:include/arc.archives.class.php
2、查找(209位置)
- //设置全局环境变量
- $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];
- @SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives');
- }
- //完成附加表信息读取
- unset($row);
- 在 @SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives');
3、加入下面代码
- //替换图片描述为标题
- $this->Fields['body'] = str_ireplace("<img " ,
- "<img alt='".$this->Fields['title'].",手机壁纸下载(www.plbz.net)",$this->Fields['body']);
- $this->Fields['imgurls'] = str_ireplace("<img " ,
- "<img alt='".$this->Fields['title'].",手机壁纸下载(www.plbz.net)",$this->Fields['imgurls']);
- $this->Fields['introduce'] = str_ireplace("<img " ,
- "<img alt='".$this->Fields['title'].",手机壁纸下载(www.plbz.net)",$this->Fields['introduce']);
演示:
手机壁纸:http://www.plbz.net/