Beispiel #1
0
function cookTemplate()
{
    global $db_htmifopen;
    $output = ob_get_contents();
    $output = str_replace(array('<!--<!---->', "<!---->\r\n", '<!---->', '<!-- -->', "\t\t\t"), '', $output);
    if ($db_htmifopen) {
        $output = preg_replace("/\\<a(\\s*[^\\>]+\\s*)href\\=([\"|\\']?)((index|cate|thread|read|faq|rss)\\.php\\?[^\"\\'>\\s]+\\s?)[\"|\\']?/ies", "Htm_cv('\\3','<a\\1href=\"')", $output);
    }
    updateCacheData();
    return $output;
}
Beispiel #2
0
function footer()
{
    global $db, $db_obstart, $db_footertime, $db_htmifopen, $P_S_T, $mtablewidth, $db_ceoconnect, $wind_version, $imgpath, $stylepath, $footer_ad, $db_union, $timestamp, $db_icp, $db_icpurl, $db_advertdb, $groupid, $SCR, $db_ystats_ifopen, $db_ystats_unit_id, $db_ystats_style, $db_redundancy, $pwServer, $db_ifcredit, $credit_pop, $db_foot, $db_mode, $db_modes, $shortcutforum, $_G, $winddb, $db_toolbar, $winduid, $db_menuinit, $db_appifopen, $db_job_ispop, $db_job_isopen, $db_siteappkey;
    defined('AJAX') && ajax_footer();
    Update_ol();
    $wind_spend = '';
    $ft_gzip = ($db_obstart ? 'Gzip enabled' : 'Gzip disabled') . $db_union[3];
    if ($db_footertime == 1) {
        $t_array = explode(' ', microtime());
        $totaltime = number_format($t_array[0] + $t_array[1] - $P_S_T, 6);
        $qn = $db ? $db->query_num : 0;
        $wind_spend = "Total {$totaltime}(s) query {$qn},";
    }
    $ft_time = get_date($timestamp, 'm-d H:i');
    $db_icp && ($db_icp = "<a href=\"http://www.miibeian.gov.cn\" target=\"_blank\">{$db_icp}</a>");
    if ($db_toolbar) {
        if ($_COOKIE['toolbarhide']) {
            $toolbarstyle = 'style="display:none"';
            $openbarstyle = '';
            $closebarstyle = 'style="display:none"';
        } else {
            $toolbarstyle = '';
            $openbarstyle = 'style="display:none"';
            $closebarstyle = '';
            if ($db_appifopen) {
                $appshortcut = trim($winddb['appshortcut'], ',');
                if (!empty($appshortcut) && $db_siteappkey) {
                    $appclient = L::loadClass('appclient');
                    $bottom_appshortcut = $appclient->userApplist($winduid, $appshortcut, 1);
                }
            }
        }
    }
    $db_menuinit = trim($db_menuinit, ',');
    runJob();
    require PrintEot('footer');
    if ($db_advertdb['Site.PopupNotice'] || $db_advertdb['Site.FloatLeft'] || $db_advertdb['Site.FloatRight'] || $db_advertdb['Site.FloatRand']) {
        require PrintEot('advert');
    }
    $output = ob_get_contents();
    if ($db_htmifopen) {
        $output = preg_replace("/\\<a(\\s*[^\\>]+\\s*)href\\=([\"|\\']?)((index|cate|thread|read|faq|rss)\\.php\\?[^\"\\'>\\s]+\\s?)[\"|\\']?/ies", "Htm_cv('\\3','<a\\1href=\"')", $output);
    }
    if ($db_redundancy && $SCR != 'post') {
        /*
        $output = str_replace(
        	array("\r","\n\n","\n\t","\n ",">\n","\n<","}\n","{\n",";\n","/\n","\t ",">\t","\t<","}\t","{\t",";\t","/\t",'  ','<!--<!---->','<!---->'),
        	array('',"\n",' ',' ','>','<','}','{',';','/',' ','>','<','}','{',';','/',' ','',''),
        	$output
        );
        */
        $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 ($SCR != 'post') {
        $ceversion = defined('CE') ? 1 : 0;
        $output .= "<script language=\"JavaScript\" src=\"http://init.phpwind.net/init.php?sitehash={$GLOBALS[db_sitehash]}&v={$wind_version}&c={$ceversion}\"></script>";
    }
    if ($groupid == 'guest' && !defined('MSG') && GetGcache()) {
        require_once R_P . 'require/guestfunc.php';
        creatguestcache($output);
    }
    updateCacheData();
    echo ObContents($output);
    unset($output);
    N_flush();
    exit;
}
Beispiel #3
0
/**
 * 更新可视化页面的静态文件
 * @param $sign
 */
function portalStatic($sign, $_viewer = '', $name = '')
{
    $portalPageService = L::loadClass('portalpageservice', 'area');
    if (!$portalPageService->checkPortal($sign)) {
        if ($name) {
            $portalPageService->addPortalPage(array('sign' => $sign, 'title' => $name));
        } else {
            Showmsg('函数portalEcho调用出错,请设置本函数的第三个参数,定义该调用页面的名称');
        }
    }
    $lockName = 'portal_' . $sign;
    if (!procLock($lockName)) {
        return false;
    }
    $staticPath = S::escapePath(PORTAL_PATH . $sign);
    if (!is_dir($staticPath)) {
        return false;
    }
    $staticPath = S::escapePath(PORTAL_PATH . $sign . '/index.html');
    $otherOutput = ob_get_contents();
    ob_clean();
    $invokeService = L::loadClass('invokeservice', 'area');
    $pageConfig = $invokeService->getEffectPageInvokePieces('other', $sign);
    $tplGetData = L::loadClass('tplgetdata', 'area');
    $tplGetData->init($pageConfig);
    require portalEot($sign);
    $temp = ob_get_contents();
    $temp = str_replace(array('<!--<!---->', "<!---->\r\n", '<!---->', '<!-- -->', "\t\t\t"), '', $temp);
    //$success = pwCache::writeover($staticPath, $temp,'wb+');
    $success = pwCache::setData($staticPath, $temp, false, 'wb+');
    procUnLock($lockName);
    if (!$success && !$GLOBALS['db_distribute'] && !pwCache::writeover($staticPath, $temp) && !is_writable($staticPath)) {
        //写入二次尝试
        ob_end_clean();
        ObStart();
        Showmsg('请设置' . str_replace(R_P, '', $staticPath) . '文件为可写,如果文件不存在,则新建一个空文件');
    }
    ob_clean();
    $portalPageService->setPortalStaticState($sign, 0);
    updateCacheData();
    setPortalHtmlTime($sign);
    if ($otherOutput) {
        echo $otherOutput;
    }
}