"; $UrlQuery=explode(";",rawurldecode($tmpQueryString)); $ExtLangDir=""; if(preg_match("/^LANG-/i",$UrlQuery[0])) { if(!isset($UrlQuery[2])) $UrlQuery[2]=''; if(!isset($UrlQuery[3])) $UrlQuery[3]=''; $ExtLangDir=$UrlQuery[0]; $UrlLevel1=$UrlQuery[1]; $UrlLevel2=$UrlQuery[2]; $UrlLevel3=$UrlQuery[3]; }else{ if (!isset($UrlQuery[1])) $UrlQuery[1]=''; if (!isset($UrlQuery[2])) $UrlQuery[2]=''; $UrlLevel1=$UrlQuery[0]; $UrlLevel2=$UrlQuery[1]; $UrlLevel3=$UrlQuery[2]; } if($UrlGateDebug) echo "LANG:".$ExtLangDir; //---------包含特别的翻译文件包------开始--------------------------------------- if(preg_match("/^LANG-/i",$UrlQuery[0])) {//有语言包要求 //echo $UrlQuery[0]; preg_match('/LANG-(.*)/ims',$UrlQuery[0],$tmpArray,PREG_OFFSET_CAPTURE); //var_dump($tmpArray); //exit; if($tmpArray[1][0]!='') $LANG=$tmpArray[1][0]; } if(@$_SERVER["SystemRoot"]!='C:\WINDOWS') include("./searchEngineer.php"); include("../Library/domain-index.php"); include("../Library/system_include.php"); include("../Library/AllFunction.php"); include("UrlGateFileNameArray.php");//这里是个快速检索当前文件名的一个文件,其实可以省略这个文件。直接从数组里面查到。 include("UrlGateGhostNameArray-older-karnar.php");//左边这个文件是对外部老链接做补丁用的。 $RewriteListPage="Product-List.HTM";//默认目录首页名 if($LANG!='') { $tmpGhostNameArray=$phpBaseFullDirPathName."LANG/GLOSS/".str_replace(".php","-".$LANG.".php","UrlGateGhostNameArray.php"); //echo $tmpGhostNameArray; if(is_file($tmpGhostNameArray)) { include($tmpGhostNameArray); }else{ include($BaseGateGhostNameArrayFile); } }else{ include($BaseGateGhostNameArrayFile); // echo $BaseGateGhostNameArrayFile; } //---------包含特别的翻译文件包------结束--------------------------------------- //--------开始老karnar.com补丁----2010-03-09------ //--------下面对UrlLevel1 打补丁。 //$NeedPathForOlderKarnar=True; $tmpFoundArray=foundInArray($UrlLevel1,$GhostNameLevel1); if(!$tmpFoundArray[0]) { $tmpFoundArray=foundInArray($UrlLevel1,$GhostNameLevel_older_karnar_1); if($tmpFoundArray[0]){ $_tmpArrayOldeIndex=explode("@",$tmpFoundArray[1]); $tmpFistStr=""; $i=0; foreach($_tmpArrayOldeIndex as $key=>$val) { if($i==0) { $tmpFistStr=$val; break; } $i++; } if(isset($GhostNameLevel1[$tmpFistStr][0])) $UrlLevel1=$GhostNameLevel1[$tmpFistStr][0]; } } //-------下面对UrlLevel2打补丁 $tmpFoundArray=foundInArray($UrlLevel2,$GhostNameLevel2); if(!$tmpFoundArray[0]) { $tmpFoundArray=foundInArray($UrlLevel2,$GhostNameLevel_older_karnar_2);//检查出现在补丁中的位置。 if($tmpFoundArray[0]){ $_tmpArrayOldeIndex=explode("@",$tmpFoundArray[1]); $tmpFistStr=""; $tmpSecondStr=""; $i=0; foreach($_tmpArrayOldeIndex as $key=>$val) { if($i==0) $tmpFistStr=$val; if($i==1) { $tmpSecondStr=$val; break; } $i++; } if (isset($GhostNameLevel2[$tmpFistStr][$tmpSecondStr][0])) $UrlLevel2=$GhostNameLevel2[$tmpFistStr][$tmpSecondStr][0]; }else{//这里存在目录更本被删除的情况。 } } //-------下面对UrlLevel3打补丁 $tmpFoundArray=foundInArray($UrlLevel3,$GhostNameLevel3); if(!$tmpFoundArray[0]) { $tmpFoundArray=foundInArray($UrlLevel3,$GhostNameLevel_older_karnar_3);//检查出现在补丁中的位置。 if($tmpFoundArray[0]){ $_tmpArrayOldeIndex=explode("@",$tmpFoundArray[1]); $tmpFistStr=""; $tmpSecondStr=""; $tmpThirdStr=""; $i=0; foreach($_tmpArrayOldeIndex as $key=>$val) { if($i==0) $tmpFistStr=$val; if($i==1) $tmpSecondStr=$val; if($i==2) { $tmpThirdStr=$val; break; } $i++; } $UrlLevel3=''; if(isset($GhostNameLevel2[$tmpFistStr][$tmpSecondStr][$tmpThirdStr][0])) $UrlLevel3=$GhostNameLevel2[$tmpFistStr][$tmpSecondStr][$tmpThirdStr][0]; }else{//这里存在第二个目录被删除的情况,直接负值。 } } //-------补丁结束-------------2010-03-09-------------------- //--------据诶数老karnar.com补丁-------- //==============Find Level1=============== $FindCount1=0; $FindCount2=0; $FindCount3=0; //var_dump($UrlQuery); $GhostLeve1=""; if($UrlGateDebug) echo "
UrlLevel1.".$UrlLevel1; if($UrlGateDebug) echo "
UrlLevel2.".$UrlLevel2; if($UrlGateDebug) echo "
UrlLevel3.".$UrlLevel3; $MemoID=''; $SeoDirID=''; if($UrlLevel1=="Product-List") { //此处说明是Product-List.HTM $FindCount1=1; $GhostLeve1=""; }else{ foreach($GhostNameLevel1 as $key=>$val){ foreach($val as $key1=>$val1){ if(initializeString($val1)==initializeString($UrlLevel1)){ $FindCount1++; $GhostLeve1=$key; $SeoDirID=$key1; break; } if($FindCount1>0) break; } } } if($UrlGateDebug) echo "
GhostLeve1".$GhostLeve1; //==============Find Level2=============== //if($FindCount1>0){ //如果找到第一层(产品大类) if($UrlLevel2=="Product-List") { $FindCount2=2; $GhostLeve2=""; }else{ if (!isset($GhostNameLevel2[$GhostLeve1])) $GhostNameLevel2[$GhostLeve1]=null; if(is_array($GhostNameLevel2[$GhostLeve1])){ $FindCount2=0; $GhostLeve2=""; foreach($GhostNameLevel2[$GhostLeve1] as $key=>$val){ foreach($val as $key1=>$val1){ if(initializeString($val1)==initializeString($UrlLevel2)){ $FindCount2++; $GhostLeve2=$key; break; } } if($FindCount2>0) break; } } } //} if($UrlGateDebug) echo "
GhostLeve2:".$GhostLeve2; //==============Find Level3=============== if($FindCount2>0){ //如果找到第二层(产品小类) if($UrlLevel3=="Product-List") { $FindCount3=2; $GhostLeve3=""; }else{ //$GhostNameLevel3["LedSeries"]["LED WALL WASHER LIGHT"] //var_dump($GhostNameLevel3[$GhostLeve1][$GhostLeve2]); //echo $GhostLeve1."-".$GhostLeve2; //exit; if($GhostLeve2!='' && isset($GhostNameLevel3[$GhostLeve1][$GhostLeve2]) && is_array($GhostNameLevel3[$GhostLeve1][$GhostLeve2]) ){ $FindCount3=0; $GhostLeve3=""; foreach($GhostNameLevel3[$GhostLeve1][$GhostLeve2] as $key=>$val){ //echo $val."=>".$val."
"; foreach($val as $key1=>$val1){ if(initializeString($val1)==initializeString($UrlLevel3)){ $FindCount3++; $GhostLeve3=$key; break; } } if($FindCount3>0) break; } } } if($UrlGateDebug) echo "
GhostLeve3:".$GhostLeve3; //exit; } //---------------------------目录级别判断完全-------------------------------- $ShowArray=array(); if (!isset($GhostLeve1)) $GhostLeve1=''; if (!isset($GhostLeve2)) $GhostLeve2=''; if (!isset($GhostLeve3)) $GhostLeve3=''; if($GhostLeve1=="" && $GhostLeve2=="" && $GhostLeve3==""){//说明是第一层---- /PRODUCT/Product-List.HTM /PRODUCT/ABC/XXXX.HTM if(is_array($GhostNameLevel1)){ $i=0; foreach($GhostNameLevel1 as $key=>$val){ if (!isset($GhostDir1)) $GhostDir1=null; $_tmpPage=$GhostDir1[$key]; if (!isset($GhostNameLevel2[$key])) $GhostNameLevel2[$key]=null; $PointSum=count($GhostNameLevel2[$key]); if(count($val)>0){ foreach($val as $kk=>$vv){ if ($vv=="") { $ShowArray[$i]['KEY']=rawurlencode($key); }else{ $ShowArray[$i]['KEY']=rawurlencode($vv);// } if($PointSum>0){ if ($vv=="") { $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($key)."/".$RewriteListPage); }else{ $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($vv)."/".$RewriteListPage); } }else{ $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($_tmpPage)); } $i++; } }else{ $ShowArray[$i]['KEY']=rawurlencode($key); $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($_tmpPage)); } $i++; } } } //$GhostNameLevel1 if($GhostLeve1!="" && $GhostLeve2=="" && $GhostLeve3==""){//说明是第二层---- /PRODUCT/ABC/Product-List.HTM /PRODUCT/ABC/XXXX.HTM if(is_array($GhostNameLevel2[$GhostLeve1])){ $i=0; foreach($GhostNameLevel2[$GhostLeve1] as $key=>$val){ if (!isset($GhostNameLevel3[$GhostLeve1][$key])) $GhostNameLevel3[$GhostLeve1][$key]=null; if (!isset($GhostDir2[$GhostLeve1][$key])) $GhostDir2[$GhostLeve1][$key]=null; $_tmpPage=$GhostDir2[$GhostLeve1][$key]; $PointSum=count($GhostNameLevel3[$GhostLeve1][$key]); if(count($val)>0){//说明还有子项目。 //var_dump($val); //exit; foreach($val as $kk=>$vv){ if ($vv=="") { //exit; $ShowArray[$i]['KEY']=rawurlencode($key); }else{ $ShowArray[$i]['KEY']=rawurlencode($vv); } if($PointSum>0){ if ($vv=="") { exit; $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($key)."/".$RewriteListPage); }else{ $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($vv)."/".$RewriteListPage); } }else{ //var_dump($_tmpPage); //exit; if(is_array($_tmpPage)) { $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($_tmpPage[0])); }else{ $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($_tmpPage)); //exit; } } $i++; } }else{ $ShowArray[$i]['KEY']=rawurlencode($key); $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($_tmpPage)); } $i++; } } } if($GhostLeve1!="" && $GhostLeve2!="" && $GhostLeve3==""){//说明是第三层---- /PRODUCT/ABC/EFG/Product-List.HTM /PRODUCT/ABC/EFG/XXXX.HTM //echo "
".$GhostLeve1.'=>'.$GhostLeve2.'=>'.$GhostLeve3; if (isset($GhostNameLevel3[$GhostLeve1][$GhostLeve2]) && is_array($GhostNameLevel3[$GhostLeve1][$GhostLeve2])) { $i=0; foreach($GhostNameLevel3[$GhostLeve1][$GhostLeve2] as $key=>$val){ $_tmpPage=''; if (isset($GhostDir3[$GhostLeve1][$GhostLeve2][$key])) $_tmpPage=$GhostDir3[$GhostLeve1][$GhostLeve2][$key]; if(is_array($val) && count($val)>0){ foreach($val as $kk=>$vv){ if ($vv=="") { //exit; $ShowArray[$i]['KEY']=rawurlencode($key); }else{ $ShowArray[$i]['KEY']=rawurlencode($vv); } //var_dump($_tmpPage); //echo $key."=>".$vv; //exit; if(is_array($_tmpPage)) { $defg=0; foreach($_tmpPage as $kkkk=>$vvvv) { $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($vvvv[0])); $defg++; } if($defg>1) die("错了啊!"); }else{ $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($_tmpPage)); } $i++; } }else{ $ShowArray[$i]['KEY']=rawurlencode($key); $ShowArray[$i]['VAULE']=AddHostForShowKey(rawurlencode($_tmpPage)); } $i++; } } } if($UrlGateDebug) echo "

ShowArray:".var_dump($ShowArray)."
"; //echo $GhostLeve1."-".$GhostLeve2." ".$GhostLeve3."
";//系统调用 $Dir=$GhostLeve1; if ($GhostLeve1!="" && $GhostLeve2=="" && $GhostLeve3=="")//说明是第二层---- /PRODUCT/ABC/Product-List.HTM /PRODUCT/ABC/XXXX.HTM { if (!isset($GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3])) $GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3]=null; if (!isset($GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3])) $GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3]=null; $Page=GetPageByFileName($GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3]); $_nowPageNumber=GetPageByFileName($GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3],'EXT'); } if ($GhostLeve1!="" && $GhostLeve2!="" && $GhostLeve3=="")//说明是第三层---- /PRODUCT/ABC/EFG/Product-List.HTM /PRODUCT/ABC/EFG/XXXX.HTM { if (isset($GhostDir2[$GhostLeve1][$GhostLeve2])) { $Page=GetPageByFileName($GhostDir2[$GhostLeve1][$GhostLeve2]); $_nowPageNumber=GetPageByFileName($GhostDir2[$GhostLeve1][$GhostLeve2],'EXT'); } //GetPageByFileName } if ($GhostLeve1!="" && $GhostLeve2!="" && $GhostLeve3!="")//说明是第四层需要读取页面了---- /PRODUCT/ABC/EFG/Product-List.HTM /PRODUCT/ABC/EFG/XXXX.HTM { //if($UrlGateDebug) echo "=======>".$GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3]; if (isset($GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3])) { $Page=GetPageByFileName($GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3]); $_nowPageNumber=GetPageByFileName($GhostDir3[$GhostLeve1][$GhostLeve2][$GhostLeve3],'EXT'); } } if (!isset($_nowPageNumber)) $_nowPageNumber=''; if (!isset($Page)) $Page=''; if ($_nowPageNumber=='') $_nowPageNumber=0; if ($Page=='') $Page=0; $GlossaryTitle=""; $SeoImageArray['Name']=""; $SeoImageArray['Alt']=""; if($UrlLevel1!='') { $GlossaryTitle.=$UrlLevel1; $SeoImageArray['Alt'].=$UrlLevel1; $SeoImageArray['Name']=$UrlLevel1; } if($UrlLevel2!='') { $GlossaryTitle.=" > ".$UrlLevel2; $SeoImageName=$UrlLevel1; $SeoImageArray['Alt'].=",".$UrlLevel2; $SeoImageArray['Name']=$UrlLevel2; } if($UrlLevel3!='') { $GlossaryTitle.=" > ".$UrlLevel3; $SeoImageArray['Alt'].=",".$UrlLevel3; $SeoImageArray['Name']=$UrlLevel3; } if ($GhostLeve1=='') $GlossaryTitle='Product Glossary'; $_ProductName=''; if($GhostLeve1!="" && $GhostLeve2=="" && $GhostLeve3==""){ $_ProductName=$UrlLevel1; } if($GhostLeve1!="" && $GhostLeve2!="" && $GhostLeve3==""){ $_ProductName=$UrlLevel2; } if($GhostLeve1!="" && $GhostLeve2!="" && $GhostLeve3!=""){ $_ProductName=$UrlLevel2." ".$UrlLevel3; } //-----开始预备Gloss页面导航表格-------开始---- $i=0; $OneLineXcols=4; $ShowTabbleStr=""; reset($ShowArray); //$RewriteListPage; Product-List.HTM foreach($ShowArray as $key=>$val){ $ShowTabbleStr.=''; $i++; if ($i%$OneLineXcols==0) $ShowTabbleStr.="\n"; } $ShowTabbleStr.="
'; if(preg_match('/'.$RewriteListPage.'$/',rawurldecode($val["VAULE"]))){ $ShowTabbleStr.= "*".rawurldecode($val['KEY']).""; }else{ $ShowTabbleStr.= "".rawurldecode($val['KEY']).""; } $ShowTabbleStr.='
"; //-----开始预备Gloss页面导航表格-------结束---- //因为header.php要接收 $GlossaryTitle 参数,所以要放在下面这个位置 $JustTitleString=$GlossaryTitle; include($phpBaseFullDirPathName."Library/header.php"); $PageMemoContent=GetMemo($ProductArray,$Page,$Dir); include("ShowContent.php"); ?>