예제 #1
0
 public static function make_html()
 {
     global $_G;
     if (self::$htmlfilename) {
         $filepath = DISCUZ_ROOT . '/' . self::$htmlfilename . '.' . $_G['setting']['makehtml']['extendname'];
         dmkdir(dirname($filepath));
         $cend = '</body></html>';
         $code = ob_get_clean() . $cend;
         $code = preg_replace('/language\\s*=[\\s|\'|\\"]*php/is', '_', $code);
         $code = str_replace(array('<?', '?>'), array('&lt;?', '?&gt;'), $code);
         if (file_put_contents($filepath, $code) !== false) {
             $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
             if (self::$callback && is_callable(self::$callback)) {
                 call_user_func(self::$callback);
                 self::$callback = self::$callbackdata = null;
             }
             self::$returndata['status'] = 'html_ok';
             if (isset(self::$viewurl)) {
                 self::$returndata['path'] = self::$viewurl;
             } else {
                 self::$returndata['path'] = self::$htmlfilename . '.' . $_G['setting']['makehtml']['extendname'];
             }
             showmessage('do_success', null, self::$returndata);
         }
     }
 }
예제 #2
0
 public static function make_html()
 {
     global $_G;
     if (self::$htmlfilename) {
         $filepath = DISCUZ_ROOT . '/' . self::$htmlfilename . '.' . $_G['setting']['makehtml']['extendname'];
         dmkdir(dirname($filepath));
         $cend = '</body></html>';
         if (file_put_contents($filepath, ob_get_clean() . $cend) !== false) {
             $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
             if (self::$callback && is_callable(self::$callback)) {
                 call_user_func(self::$callback);
                 self::$callback = self::$callbackdata = null;
             }
             self::$returndata['status'] = 'html_ok';
             if (isset(self::$viewurl)) {
                 self::$returndata['path'] = self::$viewurl;
             } else {
                 self::$returndata['path'] = self::$htmlfilename . '.' . $_G['setting']['makehtml']['extendname'];
             }
             showmessage('do_success', null, self::$returndata);
         }
     }
 }