专注ECSHOP第九年
始自2007,服务二千多商户,不断为您增光溢彩

1招去除ECSHOP图片描述的额外链接并设定图片为绝对地址

2行代码轻松解决:

$goods[‘goods_desc’] = preg_replace(‘/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i’, ”, $goods[‘goods_desc’]);//去除图片的链接
$goods[‘goods_desc’]= str_ireplace(‘src=”/images/’ ,’src=”http://api.uuecs.com/images/’,$goods[‘goods_desc’]);//把图片设定为绝对地址

 

当然还有种 办法,去除所有商品链接。不过杀伤力太强了~~

$goods[‘goods_desc’] = ereg_replace(“<a [^>]*>|<\/a>”,””,$row[‘goods_desc’]);  // 去掉商品描述所有链接

 

以上可在includes/lib_goods.php 约744行操作。

谨记。

未经允许不得转载:阿牛ECSHOP » 1招去除ECSHOP图片描述的额外链接并设定图片为绝对地址
1

Parse error: syntax error, unexpected '}' in /www/wwwroot/blog2018.uuecs.com/wp-content/themes/DUX/comments.php on line 31