搜索引擎對織夢dedecms圖片的認知就是圖片添加的屬性,在織夢后天上傳圖片的時候是不會添加屬性的,雖然也有title選項,但是是沒有效果的,想要添加屬性還要在配置文件中做出相應的修改。
打開include/arc.archives.class.php文件
找到以下代碼(一般在第204行):
//設置全局環境變量
$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');
下面添加以下代碼(“織夢中國網”就是你想要更換的圖片名稱):
$this->Fields['body'] = str_ireplace("<img " ,"<img alt='".$this->Fields['title'].",織夢中國網' ",$this->Fields['body']);
$this->Fields['imgurls'] = str_ireplace("<img " ,"<img alt='".$this->Fields['title'].",織夢中國網' ",$this->Fields['imgurls']);
$this->Fields['introduce'] = str_ireplace("<img " ,"<img alt='".$this->Fields['title'].",織夢中國網' ",$this->Fields['introduce']);