$exptime && $LOOK!="ok"){ header("location:../../exp.htm"); } if($file==""){ $file="index.php3"; } if(isset($REF_PAGE)){ $refpage=$REF_PAGE; $direct="N"; }else{ $direct="Y"; } // $opendir="$baseurl/mod/$mod/"; $openfile=$opendir.$file; $openfile=$openfile."?kdir=$kdir&nowdir=$nowdir&userid=$userid&id=$id&detail=$detail"; if($QUERY_STRING==""){ $filestring="file=index.php3.htm"; }else{ $filestring=$QUERY_STRING.".htm"; } // setcookie("REF_PAGE",$filestring); // $kk=3; if(file_exists($filestring)){ $fx=fopen($filestring,"r"); $pp=fgets($fx,100); fclose($fx); if(trim($pp)==""){ include($filestring); }else{ $kk=1; } }else{ if($filestring=="file=index.php3.htm"){ $kk=1; }elseif($direct=="Y"){ $kk=0; }else{ if(file_exists($refpage)){ // //$fp=fopen($refpage,"r"); //$con=fread($fp,120000); //fclose($fd); //$con=file_get_contents($refpage); //ob_start(); //include($refpage); //$con = ob_get_contents(); //ob_end_clean(); $con = file_get_contents($openfile); if(strstr($con,$QUERY_STRING.">")){ $kk=1; }else{ $kk=0; } }else{ $kk=0; } } } if($kk==0){ //$fd=fopen($openfile,"r"); //$con = fread($fd,120000); //ob_start(); //include($openfile); //$con = ob_get_contents(); //ob_end_clean(); $con = file_get_contents($openfile); $con=str_replace("images/","$opendir/images/",$con); $con=str_replace("\n",100); $con=str_replace("\t","",$con); $con=str_replace("\r","",$con); $con = ereg_replace(">([ ]+)<", "><", $con); $con = ereg_replace("\n([ ]+)<", "\n<", $con); $con = ereg_replace("([\n]+)", "\n", $con); fwrite($fp,$con,strlen($con)); fclose($fp); @chmod($filestring,0755); } ?>