苹果cmsv10图片失效,苹果maccms v10二次更新只替换某一个资源图片
某个资源站倒闭了,但是以前采集了很多他的资源,导致现在很多图片都不显示了.再以后的采集过程中不希望所有的图片都被重新替换,怎么才能只更新这个倒闭了的资源站的图片呢.这里做个记录
找到\application\common\model\Collect.php这个文件的第839行左右(版本不同可能行数也不同).
if (strpos(',' . $config['uprule'], 'j')!==false && (substr($info["vod_pic"], 0, 4) == "http" || empty($info['vod_pic']) ) && $v['vod_pic']!=$info['vod_pic'] ) {
$tmp = $this->syncImages($config['pic'],$v['vod_pic'],'vod');
$update['vod_pic'] = (string)$tmp['pic'];
$msg =$tmp['msg'];
}
替换为
if (strstr($info['vod_pic'],"alicdn")==true){
{
$tmp = $this->syncImages($config['pic'],$v['vod_pic'],'vod');
$update['vod_pic'] = (string)$tmp['pic'];
$msg =$tmp['msg'];
}
}else
{
if (strpos(',' . $config['uprule'], 'j')!==false && (substr($info["vod_pic"], 0, 4) == "http" || empty($info['vod_pic']) ) && $v['vod_pic']!=$info['vod_pic'] ) {
$tmp = $this->syncImages($config['pic'],$v['vod_pic'],'vod');
$update['vod_pic'] = (string)$tmp['pic'];
$msg =$tmp['msg'];
}
}
网上流传的方法不能成功。这个代码经过我改良以后,当图床或资源站失效后,再次采集,可以强制从正常的资源站获取图片。。