<?php
/*
+--------------------------------------------------------+
| O-BLOG - PHP Blog System                               |
| Copyright (c) 2004 phpBlog.CN                          |
| Support : http://www.phpBlog.cn                        |
| Author : ShiShiRui (shishirui@163.com)                 |
|--------------------------------------------------------+
*/
error_reporting(7);

require('global.php');

isLogin();
//框架左边 MENU 页面
if(isset($_GET['frame']) && @$_GET['frame'] == 'left')
{
	$title = "O-blog $var 控制面板";
	include("temp/frame_left.php");
}

//框架右边默认页面
if(isset($_GET['frame']) && @$_GET['frame'] == 'main') {
	//register_globals
	
	if (function_exists('ini_get')){
		$onoff = ini_get('register_globals');
	} else {
		$onoff = get_cfg_var('register_globals');
	}
	
	if ($onoff){
		$onoff="打开";
	}else{
		$onoff="关闭";
	}

	//file_uploads
	if (function_exists('ini_get')){
		$upload = ini_get('file_uploads');
	} else {
		$upload = get_cfg_var('file_uploads');
	}
	if ($upload){
		$upload="可以";
	}else{
		$upload="不可以";
	}

	//stat
	$table = array($mysql_prefix."blog",$mysql_prefix."class",$mysql_prefix."guestbook",$mysql_prefix."remark",$mysql_prefix."link",$mysql_prefix."trackback");
	foreach($table as $key=>$val) {
		$stat[] = $DB->fetch_one("SELECT count(*) FROM `".$val."`");
	}

	//attachments size
	$filesize = "";
	if ($handle = @opendir('uploadfiles')) {
		while (false !== ($file = readdir($handle))) {
			if($file != "." && $file != "..") {
				$filesize += filesize("uploadfiles/".$file);
			}
		}
		closedir($handle);
	}

	//db size
	$res = $DB->query("SHOW TABLE STATUS");
	while ($row = mysql_fetch_array($res))
	{
		@$datasize  += $row['Data_length'];
		@$indexsize  += $row['Index_length'];
	}
	$dbSize = $datasize+$indexsize;
	$userid = intval(getcookie('ob_userid'));
	$username = $DB->fetch_one("SELECT `username` FROM `".$mysql_prefix."admin` WHERE `id`=".$userid);
	
	include('temp/header.php');
	include('temp/frame_main.php');
	include('temp/footer.php');
}

//框架上边页面
if(isset($_GET['frame']) && @$_GET['frame'] == 'top')
{
	include("temp/frame_top.php");
}
?>