<?php


//相关产品 有图 后10个
$oldpro=$related_rows2['productPic'];
$oldprofilename= "page/".substr($oldpro,0,strrpos($oldpro,".")).".html" ;
$proptname1=pathProName($related_rows2['productName']);
$proptname1=strtolower($proptname1);
$filenamepro=$oldpropath? $oldprofilename:clearFolder($proptname1)."-".$related_rows2['ID'].".html"; //$ifcatelink
$filename=$uniproname?$related_rows2['filename']:$filenamepro;

if($pn_num<=$samecaterelapro){ //同类产品<=$samecaterelapro,找兄弟类产品 $name,$str,$dir
	$relapic=getpiclink($related_rows2['productID']); //,$filename ,$related_rows2['productPic']
	$relapiclink="../".$relapic['piclink']; //$relaprocate[2]: ../   $relaprocate[2].
	$relapicpic="../".$relapic['picsrc'];
	//echo "<br/>Pic-".$relapicpic."<br/>";
}else{ //同类产品
	$relapicpic=$SmallFoldersProducts."/".$related_rows2['productPic'];
	$relapiclink="../".$pathprofilename."/".$filename;

/*	$relapic=getpiclink($related_rows2['productID'],$related_rows2['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_rows2['productName']."</translate>\" target=\"_blank\" class=\"c-img-height\">
	
					<img src=\"".$prodda.$relapicpic."\" alt='<translate>".$products_rows['productName'].", ".$products_rows['productItemNo']."</translate>' title='<translate>".$related_rows2['productName']."</translate>' class=\"img-responsive\"  /></a>
	
					</div>
	
					<div class=\"caption pro-name\"><h5>
	
					<a href=\"".$relapiclink."\" title='<translate>".$related_rows2['productName']."</translate>' ><translate>".$related_rows2['productName']."</translate></a>
	
					</h5>
	
					</div>
	
					</div>
	
					</div>";
	}
}
?>

