load($xml); $rows = $doc->getElementsByTagName( "item" ); foreach($rows as $node){ $company = $node->getElementsByTagName($lang."_company" )->item(0)->nodeValue; if(empty($company)) $company = $node->getElementsByTagName( "en_company" )->item(0)->nodeValue; $phone = $node->getElementsByTagName($lang."_phone" )->item(0)->nodeValue; if(empty($phone)) $phone = $node->getElementsByTagName( "en_phone" )->item(0)->nodeValue; $email = $node->getElementsByTagName($lang."_email" )->item(0)->nodeValue; if(empty($email)) $email = $node->getElementsByTagName( "en_email" )->item(0)->nodeValue; $msn = $node->getElementsByTagName($lang."_msn" )->item(0)->nodeValue; if(empty($msn)) $msn = $node->getElementsByTagName( "en_msn" )->item(0)->nodeValue; $address = $node->getElementsByTagName($lang."_address" )->item(0)->nodeValue; if(empty($address)) $address = $node->getElementsByTagName( "en_address" )->item(0)->nodeValue; $url = $node->getElementsByTagName("url" )->item(0)->nodeValue; $url = trim($url); $Makes = $node->getElementsByTagName( "Makes" )->item(0)->nodeValue; $Part = $node->getElementsByTagName( "Part" )->item(0)->nodeValue; } $PC = getCityName($row['province'],$row['city']); $logo = 'http://yiparts.com/2008/pic/ClientLogo/small/'.$row['username'].'.gif'; $urlstr=$url; if(strpos($url,'http://')===false) $url='http://'.$url; if(!empty($company)){ $phone=preg_replace('/\s{2,}| /',' ',strip_tags($phone)); $phone=str_replace(' ','',$phone); //$phone=str_replace(' ',' ',$phone); //$phone=str_replace(chr(13),'',$phone); ($msn=='')?$msnlink='':$msnlink=' '; $ClientList.='
'; $i++; } } //echo $totalpage.'|'.$page; if ($totalpage>1) { echo ''; } if ($ClientList!='') { echo $ClientList; } else { echo '
1、暂时没有任何供应商销售此配件!
'; } mysql_free_result($result); ?>