[ Index ] |
|
Code source de e107 0.7.8 |
1 // $Id: languagelinks.sc,v 1.6 2006/09/10 23:59:55 e107coders Exp $ 2 global $pref; 3 $sep = (defined("LANGLINKS_SEPARATOR")) ? LANGLINKS_SEPARATOR : "| "; 4 $cursub = explode(".",$_SERVER['HTTP_HOST']); 5 6 require_once(e_HANDLER."language_class.php"); 7 $lng = new language; 8 9 if($parm) 10 { 11 $tmp = explode(",",$parm); 12 } 13 else 14 { 15 $tmp = explode(",",e_LANLIST); 16 sort($tmp); 17 } 18 19 if(count($tmp) < 2) 20 { 21 return; 22 } 23 24 foreach($tmp as $val) 25 { 26 $code = $lng->convert($val); 27 $name = $lng->toNative($val); 28 $subdom = (isset($cursub[2])) ? $cursub[0] : ""; 29 30 if(isset($pref['multilanguage_subdomain']) && $pref['multilanguage_subdomain']){ 31 $link = (e_QUERY) ? str_replace($_SERVER['HTTP_HOST'],$code.$pref['multilanguage_subdomain'],e_SELF)."?".e_QUERY : str_replace($_SERVER['HTTP_HOST'],$code.$pref['multilanguage_subdomain'],e_SELF); 32 } 33 else{ 34 $link = (e_QUERY) ? e_SELF."?[".$code."]".e_QUERY : e_SELF."?[".$code."]"; 35 } 36 if(isset($pref['multilanguage_subdomain']) && $pref['multilanguage_subdomain'] && $val == $pref['sitelanguage']){ 37 $link = str_replace($code.$pref['multilanguage_subdomain'],"www".$pref['multilanguage_subdomain'],$link); 38 } 39 $class = ($val == e_LANGUAGE) ? "languagelink_active" : "languagelink"; 40 $ret[] = "<a class='{$class}' href='{$link}' title=\"".$name."\">".$name."</a>\n"; 41 } 42 43 return implode($sep,$ret);
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |