<?php

//相关产品 有图 前10个

$oldpro=$related_rows['productPic'];
$oldprofilename= "page/".substr($oldpro,0,strrpos($oldpro,".")).".html" ;
$proptname1=pathProName($related_rows['productName']);
$proptname1=strtolower($proptname1);
$filenamepro=$oldpropath? $oldprofilename:clearFolder($proptname1)."-".$related_rows['ID'].".html"; //$ifcatelink
$filename=$uniproname?$related_rows['filename']:$filenamepro;

//echo $filename."--<br/>";


if($pn_num<=$samecaterelapro){//同类产品<=$samecaterelapro,找兄弟类产品 $name,$str,$dir

	$relapic=getpiclink($related_rows['productID']); //,$filename ,$related_rows['productPic']
	$relapiclink="../".$relapic['piclink']; //$relaprocate[2].
	$relapicpic="../".$relapic['picsrc']; //$relaprocate[2].
}else{
	$relapicpic=$SmallFoldersProducts."/".$related_rows['productPic'];
	$relapiclink="../".$pathprofilename."/".$filename;

/*	$relapic=getpiclink($related_rows['productID'],$related_rows['productPic'],$filename);
	$relapiclink=$relapic['piclink'];
	$relapicpic=$relapic['picsrc'];
*/ }

if(!$relapic===false){ //没有相关
	if(strpos( $related_products ,$relapiclink)===false){ //重复的不加
	$related_products.="<div class=\"col-lg-4 col-md-4 col-sm-6 col-xs-6 relate\">
	
					<div class=\"thumbnail\">
	
					<div class=\"img-pic\">
	
					<a href=\"".$relapiclink."\" title=\"<translate>".$related_rows['productName']."</translate>\" target=\"_blank\" class=\"c-img-height\">
	
					<img  src=\"".$prodda.$relapicpic."\" alt='<translate>".$products_rows['productName'].", ".$products_rows['productItemNo']."</translate>' title='<translate>".$related_rows['productName']."</translate>'class=\"img-responsive\" /></a>
	
					</div>
	
					
	
					<div class=\"caption pro-name\"><h5>
	
					<a href=\"". $relapiclink. "\" title='".$related_rows['productName']."' ><translate>".$related_rows['productName']."</translate></a></h5>
	
					</div>
	
					</div>
	
					</div>";
	}
}

?>

