コード例 #1
0
ファイル: staticpage.class.php プロジェクト: jechiy/PHPWind
 function createHtml($readdb)
 {
     extract($this->vars);
     ob_end_clean();
     ObStart();
     include S::escapePath($this->tpl);
     $ceversion = defined('CE') ? 1 : 0;
     $content = str_replace(array('<!--<!---->', '<!---->'), array('', ''), ob_get_contents());
     $content .= "<script type=\"text/javascript\">(function(d,t){\nvar url=\"http://init.phpwind.net/init.php?sitehash={$db_sitehash}&v={$wind_version}&c={$ceversion}\";\nvar g=d.createElement(t);g.async=1;g.src=url;d.body.appendChild(g)}(document,\"script\"));</script>";
     ob_end_clean();
     ObStart();
     if (!is_dir(R_P . $this->htmdir . '/' . $this->fid)) {
         @mkdir(R_P . $this->htmdir . '/' . $this->fid);
         @chmod(R_P . $this->htmdir . '/' . $this->fid, 0777);
         pwCache::writeover(R_P . "{$this->htmdir}/{$this->fid}/index.html", '');
         @chmod(R_P . "{$this->htmdir}/{$this->fid}/index.html", 0777);
     }
     if (!is_dir(R_P . $this->htmdir . '/' . $this->fid . '/' . $this->datedir)) {
         @mkdir(R_P . $this->htmdir . '/' . $this->fid . '/' . $this->datedir);
         @chmod(R_P . $this->htmdir . '/' . $this->fid . '/' . $this->datedir, 0777);
         pwCache::writeover(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/index.html", '');
         @chmod(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/index.html", 0777);
     }
     pwCache::writeover(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html", $content, "rb+", 0);
     @chmod(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html", 0777);
 }
コード例 #2
0
ファイル: global.php プロジェクト: adi00/wumaproject
function Showmsg($msg_info, $dejump = 0)
{
    @extract($GLOBALS, EXTR_SKIP);
    global $stylepath, $tablewidth, $mtablewidth, $tplpath, $db;
    define('PWERROR', 1);
    $msg_info = getLangInfo('msg', $msg_info);
    if (defined('AJAX')) {
        echo $msg_info;
        ajax_footer();
    }
    $showlogin = false;
    if ($dejump != '1' && $groupid == 'guest' && $REQUEST_URI == str_replace(array('register', 'login'), '', $REQUEST_URI) && (!$db_pptifopen || $db_ppttype != 'client')) {
        if (strpos($REQUEST_URI, 'post.php') !== false || strpos($REQUEST_URI, 'job.php?action=vote') !== false || strpos($REQUEST_URI, 'job.php?action=pcjoin') !== false) {
            $tmpTid = (int) GetGP('tid', 'GP');
            $tmpTid && ($REQUEST_URI = substr($REQUEST_URI, 0, strrpos($REQUEST_URI, '/')) . "/read.php?tid={$tmpTid}&toread=1");
        }
        $jumpurl = "http://" . $pwServer['HTTP_HOST'] . $REQUEST_URI;
        list(, $qcheck) = explode("\t", $db_qcheck);
        $qkey = $qcheck && $db_question ? array_rand($db_question) : '';
        $showlogin = true;
    }
    extract(L::style());
    list($_Navbar, $_LoginInfo) = pwNavBar();
    ob_end_clean();
    ObStart();
    require_once PrintEot('showmsg');
    exit;
}
コード例 #3
0
ファイル: admincp.php プロジェクト: adi00/wumaproject
$ceversion = defined('CE') ? 1 : 0;
#PHPWind version
list($wind_version, $wind_repair, $wind_from) = explode(',', WIND_VERSION);
InitGP(array('adminjob', 'admintype', 'type', 'hackset', 'a_type', 'action', 'verify', 'adskin', 'job', 'ajax', 'admin_keyword'));
if (strpos($adminjob, '..') !== false || $admintype && strpos($admintype, '..') !== false) {
    exit('Forbidden');
}
isset($_GET['adskin']) && ($adskin = GetGP('adskin'));
isset($adskin) ? Cookie('adskin', $adskin) : ($adskin = GetCookie('adskin'));
if ($ajax) {
    define('AJAX', '1');
}
if ($db_forcecharset && !defined('AJAX')) {
    @header("Content-Type:text/html; charset={$db_charset}");
}
ObStart();
file_exists('install.php') && adminmsg('installfile_exists');
$admin_file = $pwServer['PHP_SELF'];
$REQUEST_URI = trim($pwServer['PHP_SELF'] . '?' . $pwServer['QUERY_STRING'], '#');
if ($adminjob == 'quit') {
    Cookie('AdminUser', '', 0);
    ObHeader($admin_file);
}
$imgpath = $db_http != 'N' ? $db_http : "{$db_bbsurl}/{$db_picpath}";
$attachpath = $db_attachurl != 'N' ? $db_attachurl : "{$db_bbsurl}/{$db_attachname}";
$imgdir = R_P . $db_picpath;
$attachdir = R_P . $db_attachname;
$pw_posts = 'pw_posts';
$pw_tmsgs = 'pw_tmsgs';
if (D_P != R_P && $db_http != 'N') {
    $R_url = substr($db_http, -1) == '/' ? substr($db_http, 0, -1) : $db_http;
コード例 #4
0
 function createHtml($readdb)
 {
     extract($this->vars);
     ob_end_clean();
     ObStart();
     include Pcv($this->tpl);
     $ceversion = defined('CE') ? 1 : 0;
     $content = str_replace(array('<!--<!---->', '<!---->'), array('', ''), ob_get_contents());
     $content .= "<script language=\"JavaScript\" src=\"http://init.phpwind.net/init.php?sitehash={$db_sitehash}&v={$wind_version}&c={$ceversion}\"></script>";
     ob_end_clean();
     ObStart();
     if (!is_dir(R_P . $this->htmdir . '/' . $this->fid)) {
         @mkdir(R_P . $this->htmdir . '/' . $this->fid);
         @chmod(R_P . $this->htmdir . '/' . $this->fid, 0777);
         writeover(R_P . "{$this->htmdir}/{$this->fid}/index.html", '');
         @chmod(R_P . "{$this->htmdir}/{$this->fid}/index.html", 0777);
     }
     if (!is_dir(R_P . $this->htmdir . '/' . $this->fid . '/' . $this->datedir)) {
         @mkdir(R_P . $this->htmdir . '/' . $this->fid . '/' . $this->datedir);
         @chmod(R_P . $this->htmdir . '/' . $this->fid . '/' . $this->datedir, 0777);
         writeover(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/index.html", '');
         @chmod(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/index.html", 0777);
     }
     writeover(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html", $content, "rb+", 0);
     @chmod(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html", 0777);
 }
コード例 #5
0
ファイル: common.php プロジェクト: adi00/wumaproject
function ObContents($output)
{
    //Copyright (c) 2003-09 PHPWind
    ob_end_clean();
    $getHAE = GetServer('HTTP_ACCEPT_ENCODING');
    if (!headers_sent() && $GLOBALS['db_obstart'] && $getHAE && N_output_zip() != 'ob_gzhandler') {
        $encoding = '';
        if (strpos($getHAE, 'x-gzip') !== false) {
            $encoding = 'x-gzip';
        } elseif (strpos($getHAE, 'gzip') !== false) {
            $encoding = 'gzip';
        }
        if ($encoding && function_exists('crc32') && function_exists('gzcompress')) {
            header('Content-Encoding: ' . $encoding);
            $outputlen = strlen($output);
            $outputzip = "�";
            $outputzip .= substr(gzcompress($output, $GLOBALS['db_obstart']), 0, -4);
            $outputzip .= @pack('V', crc32($output));
            $output = $outputzip . @pack('V', $outputlen);
        } else {
            ObStart();
        }
    } else {
        ObStart();
    }
    return $output;
}
コード例 #6
0
ファイル: common.php プロジェクト: jechiy/PHPWind
/**
 * 更新可视化页面的静态文件
 * @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;
    }
}
コード例 #7
0
 function creatStopicHtml($stopic_id)
 {
     global $db_charset, $wind_version, $db_bbsurl;
     $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);
     writeover($stopicDir, $output);
     ObStart();
 }
コード例 #8
0
ファイル: global.php プロジェクト: sherlockhouse/aliyun
/**
 * 显示系统提示信息
 *
 * @param string $msg_info 信息内容
 * @param int $dejump ?
 */
function Showmsg($msg_info, $dejump = 0)
{
    @extract($GLOBALS, EXTR_SKIP);
    global $stylepath, $tablewidth, $mtablewidth, $tplpath, $db;
    define('PWERROR', 1);
    $msg_info = getLangInfo('msg', $msg_info);
    if (defined('AJAX')) {
        echo $msg_info;
        ajax_footer();
    }
    $showlogin = false;
    if ($dejump != '1' && $groupid == 'guest' && $REQUEST_URI == str_replace(array('register', 'login'), '', $REQUEST_URI) && (!$db_pptifopen || $db_ppttype != 'client')) {
        if (strpos($REQUEST_URI, 'post.php') !== false || strpos($REQUEST_URI, 'job.php?action=vote') !== false || strpos($REQUEST_URI, 'job.php?action=pcjoin') !== false) {
            $tmpTid = (int) S::getGP('tid', 'GP');
            $tmpTid && ($REQUEST_URI = substr($REQUEST_URI, 0, strrpos($REQUEST_URI, '/')) . "/read.php?tid={$tmpTid}&toread=1");
        }
        $jumpurl = "http://" . $pwServer['HTTP_HOST'] . $REQUEST_URI;
        //list(, $qcheck) = explode("\t", $db_qcheck);
        $qkey = $db_ckquestion & 2 && $db_question ? array_rand($db_question) : '';
        $showlogin = true;
    }
    extract(L::style());
    //css file for showmsg
    require L::style('', $skinco, true);
    if ("wind" != $tplpath && file_exists(D_P . 'data/style/' . $tplpath . '_css.htm')) {
        $css_path = D_P . 'data/style/' . $tplpath . '_css.htm';
    } else {
        $css_path = D_P . 'data/style/wind_css.htm';
    }
    //end css file
    list($_Navbar, $_LoginInfo) = pwNavBar();
    ob_end_clean();
    ObStart();
    /*
    	if (defined('AREA_PAGE') && function_exists('areaLoadFrontView')) {
    		require_once areaLoadFrontView('area_manage_showmsg');exit;
    	}*/
    require_once PrintEot('showmsg');
    exit;
}