 <?php 
 if(LANGICOSWITCH=='y'){
 $sql = "SELECT id,name,lang,langpath,domain from ".TABLE_LANG." where pbh='".USERBH."' and sta_visible='y' order by pos desc,id";
 $langnum = getnum($sql);				 				 
if($langnum>1)
{
	$rowalllang = getall($sql);
 

?>
     <div class="langtextline">
	 			  <?php 
							  $sql = "SELECT lang,name,langpath from ".TABLE_LANG." where  pbh='".USERBH."' and lang<>'" .LANG. "' and  sta_visible='y' order by pos desc,id";
								$rowlist = getall($sql);
								if($rowlist=='no') echo '暂无内容';
								else{
									if(SITEIDBYDOMAIN=='y'){ 
									 foreach ($rowalllang as  $v) {	

										    if(MAINLANG<>$v['lang']){
												   $langsrc = STAPATH.'img/langimg/'.$v['lang'].'.gif';	   
											       echo '<a  href="http://'.$v['domain'].'"><img src="'.$langsrc.'" alt="" /> '.$v['name'].'</a>';
											   }
										   } 
										 }
									else{	
										foreach($rowlist as $v){ 	
										//pre($v);							 
										  $lang=$v['lang']; 
										  $langpath=$v['langpath']; 
										  $langsrc = STAPATH.'img/langimg/'.$lang.'.gif';	

										  if($lang==MAINLANG)	$link = BASEURL;			    
										   else $link = BASEURL.$langpath.'/';
										  echo '<a   href="'.$link.'"><img src="'.$langsrc.'" alt="" /> '.$v['name'].'</a>';
										}
									}




							}


	 			  ?>

     </div>
 <?php 
     }
 }
  ?>