본문 바로가기
실시간 영화감상

{include 파일명.php} 처리 (파일명 치환 처리)

if (strstr($view[wr_content],"{include '")) {

        $n=0;

        while($n++<10 && preg_match("/{include '([\x21-\xff]*)'}/i",$view[wr_content],$reg)) {

                if (!$reg[1] || strlen($reg[1])<4) continue;

                $extend=get_extend($reg[1]);

                if ($extend!=".php" && $extend!=".html") continue;

                if (strstr($reg[1],"config.")) continue;

                $file1=str_replace("\$",$g4[path],$reg[1]);

                $file1=str_replace("@",$g4[ar_skin_path],$file1);

                //echo "$reg[1],$file1<BR>";

                if (!is_file($file1)) {

                        $view[wr_content] = str_replace("{include '$reg[1]'}","check file: $file1",$view[wr_content]);

                        continue;

                }




                ob_start();

                include $file1;

                $out = ob_get_clean();        // append this to $html and empty buffer

                $view[wr_content] = str_replace("{include '$reg[1]'}",$out,$view[wr_content]);

        }

}

댓글


Copyright ⓒ SmartWeb All rights reserved.