Beispiel #1
0
/**
 * api
 * @author zsx<*****@*****.**>
 * @package api/route/global
 * @php >= 5.2
 */
function api_route_index_function()
{
    global $zbp;
    API::$IO->bloghost = $zbp->host;
    if ($zbp->CheckRights('root')) {
        API::$IO->blogpath = $zbp->path;
        API::$IO->environment = array('php' => PHP_SYSTEM, 'x64' => IS_X64, 'server' => PHP_SERVER, 'engine' => PHP_ENGINE, 'str' => GetEnvironment());
        API::$IO->option = $zbp->option;
    }
}
Beispiel #2
0
	  <div class="divHeader"><?php 
echo $GLOBALS['lang']['msg']['error_tips'];
?>
</div>
  	  <div class="content">
	 	<div><p><?php 
echo $GLOBALS['lang']['msg']['error_info'];
?>
</p><div>
		<?php 
echo '(' . $this->type . ')' . $this->typeName . ' :     ' . strip_tags($this->message);
?>
		<?php 
echo ' (' . $GLOBALS['blogversion'] . ') ';
if (!in_array('Status: 404 Not Found', headers_list())) {
    echo '(' . GetEnvironment() . ') ';
}
?>
		</div></div>
	 	<?php 
if ($GLOBALS['option']['ZC_DEBUG_MODE']) {
    ?>
	 	<div><p><?php 
    echo $GLOBALS['lang']['msg']['file_line'];
    ?>
</p><div>
	 	<p><i><?php 
    echo $this->file;
    ?>
</i><br/></p>
	 	<table style='width:100%'>
Beispiel #3
0
function misc_phpinfo()
{
    global $zbp, $blogtitle;
    $match = array();
    $blogtitle = $zbp->name . '-phpinfo';
    ob_start();
    phpinfo();
    $s = ob_get_clean();
    if (PHP_ENGINE !== ENGINE_HHVM) {
        preg_match("/<body.*?>(.*?)<\\/body>/is", $s, $match);
    }
    ?>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<?php 
    if (strpos(GetVars('HTTP_USER_AGENT', 'SERVER'), 'Trident/')) {
        ?>
		<meta http-equiv="X-UA-Compatible" content="IE=EDGE"/>
	<?php 
    }
    ?>
	<meta name="robots" content="none"/>
	<meta name="generator" content="<?php 
    echo $GLOBALS['option']['ZC_BLOG_PRODUCT_FULL'];
    ?>
"/>
	<link rel="stylesheet" href="css/admin.css" type="text/css" media="screen"/>
	<script src="script/common.js" type="text/javascript"></script>
	<script src="script/c_admin_js_add.php" type="text/javascript"></script>
<?php 
    foreach ($GLOBALS['hooks']['Filter_Plugin_Other_Header'] as $fpname => &$fpsignal) {
        $fpname();
    }
    ?>
	<title><?php 
    echo $blogtitle;
    ?>
</title>
	<style type="text/css">
*{color:#000;}
pre {margin: 0; font-family: monospace;}
a:link {color: #009; text-decoration: none; background-color: #fff;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse; border: 0; width: 934px; box-shadow: 1px 2px 3px #ccc;}
.center {text-align: center;}
.center table {margin: 1em auto; text-align: left;}
.center th {text-align: center !important;}
td, th {border: 1px solid #666; font-size: 75%; vertical-align: baseline; padding: 4px 5px;}
h1 {font-size: 150%;}
h2 {font-size: 125%;}
.p {text-align: left;}
.e {background-color: #ccf; width: 300px; font-weight: bold;}
.h {background-color: #99c; font-weight: bold;}
.v {background-color: #ddd; max-width: 300px; overflow-x: auto;}
.v i {color: #999;}
img {float: right; border: 0;}
hr {display:none;}
div.bg {background: #777bb4!important;}
	</style>
</head>
<body class="short">
<div class="bg">
	<div id="wrapper">
		<div class="logo"><img src="image/admin/none.gif" title="Z-BlogPHP" alt="Z-BlogPHP"/></div>
		<?php 
    if (PHP_ENGINE === ENGINE_HHVM) {
        echo '<p style="text-align: center;">' . GetEnvironment() . '</p>';
    } else {
        echo $match[0];
    }
    ?>
	</div>
</div>
</body>
</html>
<?php 
    RunTime();
}
Beispiel #4
0
function LargeData_Misc_Statistic()
{
    global $zbp;
    $r = null;
    CountNormalArticleNums();
    CountTopArticle(null, null);
    CountCommentNums(null, null);
    $all_comments = $zbp->cache->all_comment_nums;
    $xmlrpc_address = $zbp->host . 'zb_system/xml-rpc/';
    $current_member = $zbp->user->Name;
    $current_version = ZC_VERSION_FULL;
    $all_artiles = GetValueInArrayByCurrent($zbp->db->Query($zbp->db->sql->Select($zbp->table['Post'], 'Count(log_ID) AS num', array(array('=', 'log_Type', '0')), null, 1, null)), 'num');
    $all_pages = GetValueInArrayByCurrent($zbp->db->Query($zbp->db->sql->Select($zbp->table['Post'], 'Count(log_ID) AS num', array(array('=', 'log_Type', '1')), null, 1, null)), 'num');
    $all_categorys = GetValueInArrayByCurrent($zbp->db->Query($zbp->db->sql->Select($zbp->table['Category'], 'Count(*) AS num', null, null, 1, null)), 'num');
    $all_views = '不计算';
    $all_tags = GetValueInArrayByCurrent($zbp->db->Query($zbp->db->sql->Select($zbp->table['Tag'], 'Count(*) AS num', null, null, 1, null)), 'num');
    $all_members = GetValueInArrayByCurrent($zbp->db->Query($zbp->db->sql->Select($zbp->table['Member'], 'Count(*) AS num', null, null, 1, null)), 'num');
    $current_theme = '{$zbp->theme}';
    $current_style = '{$zbp->style}';
    $current_member = '{$zbp->user->Name}';
    $system_environment = '{$system_environment}';
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['current_member']}" . '' . "</td><td class='td30'>{$current_member}</td><td class='td20'>{$zbp->lang['msg']['current_version']}</td><td class='td30'>{$current_version}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['all_artiles']}" . '' . "</td><td>{$all_artiles}</td><td>{$zbp->lang['msg']['all_categorys']}" . '' . "</td><td>{$all_categorys}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['all_pages']}" . '' . "</td><td>{$all_pages}</td><td>{$zbp->lang['msg']['all_tags']}" . '' . "</td><td>{$all_tags}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['all_comments']}" . '' . "</td><td>{$all_comments}</td><td>{$zbp->lang['msg']['all_views']}" . '' . "</td><td>{$all_views}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['current_theme']}/{$zbp->lang['msg']['current_style']}</td><td>{$current_theme}/{$current_style}</td><td>{$zbp->lang['msg']['all_members']}" . '' . "</td><td>{$all_members}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['xmlrpc_address']}</td><td>{$xmlrpc_address}</td><td>{$zbp->lang['msg']['system_environment']}</td><td>{$system_environment}</td></tr>";
    $r .= "<script type=\"text/javascript\">\$('#statistic').next('small').remove();\$('#statistic').after('<small> 更新时间:" . date("c", $zbp->cache->reload_statistic_time) . "</small>');</script>";
    $zbp->cache->reload_statistic = $r;
    $zbp->cache->reload_statistic_time = time();
    $zbp->cache->system_environment = $system_environment;
    $zbp->cache->all_article_nums = $all_artiles;
    $zbp->cache->all_page_nums = $all_pages;
    $zbp->AddBuildModule('statistics', array($all_artiles, $all_pages, $all_categorys, $all_tags, $all_views, $all_comments));
    $zbp->BuildModule();
    $zbp->SaveCache();
    $r = str_replace('{#ZC_BLOG_HOST#}', $zbp->host, $r);
    $r = str_replace('{$zbp->user->Name}', $zbp->user->Name, $r);
    $r = str_replace('{$zbp->theme}', $zbp->theme, $r);
    $r = str_replace('{$zbp->style}', $zbp->style, $r);
    $r = str_replace('{$system_environment}', GetEnvironment(), $r);
    echo $r;
}
Beispiel #5
0
function misc_statistic()
{
    global $zbp;
    $r = null;
    CountNormalArticleNums();
    CountTopArticle(null, null);
    CountCommentNums(null, null);
    $all_comments = $zbp->cache->all_comment_nums;
    $xmlrpc_address = $zbp->host . 'zb_system/xml-rpc/';
    $current_member = $zbp->user->Name;
    $current_version = $zbp->option['ZC_BLOG_VERSION'];
    $all_artiles = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Post'] . ' WHERE log_Type=0'), 'num');
    $all_pages = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Post'] . ' WHERE log_Type=1'), 'num');
    $all_categorys = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Category']), 'num');
    $all_views = $zbp->option['ZC_VIEWNUMS_TURNOFF'] == true ? 0 : GetValueInArrayByCurrent($zbp->db->Query('SELECT SUM(log_ViewNums) AS num FROM ' . $GLOBALS['table']['Post']), 'num');
    $all_tags = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) as num FROM ' . $GLOBALS['table']['Tag']), 'num');
    $all_members = GetValueInArrayByCurrent($zbp->db->Query('SELECT COUNT(*) AS num FROM ' . $GLOBALS['table']['Member']), 'num');
    $current_theme = '{$zbp->theme}';
    $current_style = '{$zbp->style}';
    $current_member = '{$zbp->user->Name}';
    $system_environment = '{$system_environment}';
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['current_member']}</td><td class='td30'><a href='../cmd.php?act=misc&type=vrs' target='_blank'>{$current_member}</a></td><td class='td20'>{$zbp->lang['msg']['current_version']}</td><td class='td30'>{$current_version}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['all_artiles']}</td><td>{$all_artiles}</td><td>{$zbp->lang['msg']['all_categorys']}</td><td>{$all_categorys}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['all_pages']}</td><td>{$all_pages}</td><td>{$zbp->lang['msg']['all_tags']}</td><td>{$all_tags}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['all_comments']}</td><td>{$all_comments}</td><td>{$zbp->lang['msg']['all_views']}</td><td>{$all_views}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['current_theme']} / {$zbp->lang['msg']['current_style']}</td><td>{$current_theme}/{$current_style}</td><td>{$zbp->lang['msg']['all_members']}</td><td>{$all_members}</td></tr>";
    $r .= "<tr><td class='td20'>{$zbp->lang['msg']['xmlrpc_address']}</td><td>{$xmlrpc_address}</td><td>{$zbp->lang['msg']['system_environment']}</td><td><a href='../cmd.php?act=misc&type=phpinfo' target='_blank'>{$system_environment}</a></td></tr>";
    $r .= "<script type=\"text/javascript\">\$('#statistic').attr('title','" . date("c", $zbp->cache->reload_statistic_time) . "');</script>";
    $zbp->cache->reload_statistic = $r;
    $zbp->cache->reload_statistic_time = time();
    $zbp->cache->system_environment = GetEnvironment();
    $zbp->cache->all_article_nums = $all_artiles;
    $zbp->cache->all_page_nums = $all_pages;
    $zbp->AddBuildModule('statistics', array($all_artiles, $all_pages, $all_categorys, $all_tags, $all_views, $all_comments));
    $zbp->BuildModule();
    $zbp->SaveCache();
    $r = str_replace('{#ZC_BLOG_HOST#}', $zbp->host, $r);
    $r = str_replace('{$zbp->user->Name}', $zbp->user->Name, $r);
    $r = str_replace('{$zbp->theme}', $zbp->theme, $r);
    $r = str_replace('{$zbp->style}', $zbp->style, $r);
    $r = str_replace('{$system_environment}', $zbp->cache->system_environment, $r);
    echo $r;
    $zbp->BuildTemplate();
}
/**
 * 后台管理显示网站信息
 */
function Admin_SiteInfo()
{
    global $zbp;
    $echostatistic = false;
    echo '<div class="divHeader">' . $zbp->lang['msg']['info_intro'] . '</div>';
    echo '<div class="SubMenu">';
    foreach ($GLOBALS['hooks']['Filter_Plugin_Admin_SiteInfo_SubMenu'] as $fpname => &$fpsignal) {
        $fpname();
    }
    echo '</div>';
    echo '<div id="divMain2">';
    echo '<table class="tableFull tableBorder table_striped table_hover" id="tbStatistic"><tr><th colspan="4"  scope="col">&nbsp;' . $zbp->lang['msg']['site_analyze'] . ($zbp->CheckRights('root') ? '&nbsp;<a href="javascript:statistic(\'?act=misc&amp;type=statistic\');" id="statistic">[' . $zbp->lang['msg']['refresh_cache'] . ']</a>' : '') . ' <img id="statloading" style="display:none" src="../image/admin/loading.gif" alt=""/></th></tr>';
    if (time() - (int) $zbp->cache->reload_statistic_time > 23 * 60 * 60 && $zbp->CheckRights('root')) {
        echo '<script type="text/javascript">$(document).ready(function(){ statistic(\'?act=misc&type=statistic\'); });</script>';
    } else {
        $echostatistic = true;
        $r = $zbp->cache->reload_statistic;
        $r = str_replace('{$zbp->user->Name}', $zbp->user->Name, $r);
        $r = str_replace('{$zbp->theme}', $zbp->theme, $r);
        $r = str_replace('{$zbp->style}', $zbp->style, $r);
        $r = str_replace('{$system_environment}', GetEnvironment(), $r);
        echo $r;
    }
    echo '</table>';
    echo '<table class="tableFull tableBorder table_striped table_hover" id="tbUpdateInfo"><tr><th>&nbsp;' . $zbp->lang['msg']['latest_news'] . ($zbp->CheckRights('root') ? '&nbsp;<a href="javascript:updateinfo(\'?act=misc&amp;type=updateinfo\');">[' . $zbp->lang['msg']['refresh'] . ']</a>' : '') . ' <img id="infoloading" style="display:none" src="../image/admin/loading.gif" alt=""/></th></tr>';
    if (time() - (int) $zbp->cache->reload_updateinfo_time > 47 * 60 * 60 && $zbp->CheckRights('root') && $echostatistic == true) {
        echo '<script type="text/javascript">$(document).ready(function(){ updateinfo(\'?act=misc&type=updateinfo\'); });</script>';
    } else {
        echo $zbp->cache->reload_updateinfo;
    }
    echo '</table>';
    echo '</div>';
    $s = file_get_contents($zbp->path . "zb_system/defend/thanks.html");
    $s = str_replace('{$lang[\'msg\'][\'develop_intro\']}', $zbp->lang['msg']['develop_intro'], $s);
    $s = str_replace('{$lang[\'msg\'][\'program\']}', $zbp->lang['msg']['program'], $s);
    $s = str_replace('{$lang[\'msg\'][\'interface\']}', $zbp->lang['msg']['interface'], $s);
    $s = str_replace('{$lang[\'msg\'][\'support\']}', $zbp->lang['msg']['support'], $s);
    $s = str_replace('{$lang[\'msg\'][\'thanks\']}', $zbp->lang['msg']['thanks'], $s);
    $s = str_replace('{$lang[\'msg\'][\'website\']}', $zbp->lang['msg']['website'], $s);
    echo $s;
    echo '<script type="text/javascript">ActiveTopMenu("topmenu1");</script>';
    echo '<script type="text/javascript">AddHeaderIcon("' . $zbp->host . 'zb_system/image/common/home_32.png' . '");</script>';
}