/** * 生成专题html文件 * * @param int $stopic_id 专题id * @return null */ function creatStopicHtml($stopic_id) { global $db_charset, $wind_version, $db_bbsurl, $db_htmifopen; $stopic = $this->getSTopicInfoById($stopic_id); if (!$stopic) { return false; } $tpl_content = $this->getStopicContent($stopic_id, 0); @extract($stopic, EXTR_SKIP); if (defined('A_P')) { include A_P . 'template/stopic.htm'; } else { include R_P . 'apps/stopic/template/stopic.htm'; } $output = str_replace(array('<!--<!---->', '<!---->'), array('', ''), ob_get_contents()); ob_end_clean(); $stopicDir = $this->getStopicDir($stopic_id, $stopic['file_name']); $output = parseHtmlUrlRewrite($output, $db_htmifopen); pwCache::writeover($stopicDir, $output); ObStart(); }
/** * 将输出缓存中的内容以ajax格式输出,并中断程序 * * @global string $db_charset */ function ajax_footer() { global $db_charset, $db_htmifopen; if (defined('SHOWLOG')) { Error::writeLog(); } $output = str_replace(array('<!--<!--<!---->', '<!--<!---->', '<!---->-->', '<!---->', '<!-- -->'), '', ob_get_contents()); if (P_W == 'admincp') { $output = preg_replace("/\\<form([^\\<\\>]*)\\saction=['|\"]?([^\\s\"'\\<\\>]+)['|\"]?([^\\<\\>]*)\\>/ies", "FormCheck('\\1','\\2','\\3')", rtrim($output, '<!--')); } else { $output = parseHtmlUrlRewrite($output, $db_htmifopen); } header("Content-Type: text/xml;charset={$db_charset}"); echo ObContents("<?xml version=\"1.0\" encoding=\"{$db_charset}\"?><ajax><![CDATA[" . $output . "]]></ajax>"); exit; }
function pwOutPut() { global $db_htmifopen, $db_redundancy, $SCR, $groupid; $masterDb = $GLOBALS['db']->getMastdb(); if ($masterDb->arr_query) { writeover(D_P . "data/sqllist.txt", $masterDb->arr_query, 'wb'); } Update_ol(); $output = parseHtmlUrlRewrite(ob_get_contents(), $db_htmifopen); if ($db_redundancy && $SCR != 'post') { $output = str_replace(array("\r", '<!--<!---->-->', '<!---->-->', '<!--<!---->', "<!---->\n", '<!---->', '<!-- -->', "<!--\n-->", "\t\t", ' ', "\n\t", "\n\n"), array('', '', '', '', '', '', '', '', '', '', "\n", "\n"), $output); } else { $output = str_replace(array('<!--<!---->-->', '<!---->-->', '<!--<!---->', "<!---->\r\n", '<!---->', '<!-- -->', "\t\t\t"), '', $output); } if (!defined('AJAX')) { require_once R_P . 'aCloud/aCloud.php'; $output .= ACloud_App_Guiding::getApp(); } if ($SCR != 'post' && !defined('AJAX')) { $ceversion = defined('CE') ? 1 : 0; $output .= "<script type=\"text/javascript\">(function(d,t){\r\nvar url=\"http://init.phpwind.net/init.php?sitehash={$GLOBALS[db_sitehash]}&v={$GLOBALS[wind_version]}&c={$ceversion}\";\r\nvar g=d.createElement(t);g.async=1;g.src=url;d.body.insertBefore(g,d.body.firstChild);}(document,\"script\"));</script>"; } if ($groupid == 'guest' && !defined('MSG') && GetGcache()) { require_once R_P . 'require/guestfunc.php'; creatguestcache($output); } if (defined('SHOWLOG')) { Error::writeLog(); } if (defined('PW_PACK_FILES')) { pwPack::files(); } echo ObContents($output); unset($output); N_flush(); exit; }