<?php
/**
 * Copyright (C) 2009  Honghao Geng (genghonghao@gmail.com)
 * $Id: main.php 349 2009-11-23 13:15:13Z genghonghao $
 */

define('IN_ADMIN', TRUE);

require_once dirname(__FILE__) . '/includes/init.php';
require_once GEN_ROOT . '/languages/' . $_CONF['lang'] . '/admin/other.lang.php';

// 验证用户是否登录 
if (false === verify_user()) {;
    header("Location: ../login.php");
}

$tpl->assign('lang', $lang);

$action = isset($_REQUEST['act']) ? $_REQUEST['act'] : 'link';

// 获得当前页面的完整URL
$current_page_url = $base_url . '/' . $current_file . '?' . get_uri_param_string();

$tpl->assign('current_page_url', $current_page_url);
$tpl->assign('base_root_url', $base_root_url);

// 上传许可文件大小
     $result = $db->result("SELECT conf_value FROM " . $db->get_table(TB_CONF) . " WHERE conf_name='update_file_max'");
     $tpl->assign('update_file_max', format_size($result[0]['conf_value'], 'K'));
    $tpl->assign('program_version', get_smartgoon_version());
    $tpl->assign('os_and_php', get_os_and_php_version());
    $tpl->assign('http_server', get_http_server_version());
    $tpl->assign('mysql_version', get_db_server_version());
    $tpl->assign('db_size', get_db_size());

    $tpl->assign('copyright', $lang['copyright']);
    $tpl->assign('manage', $lang['manage']);
    $tpl->assign('dev_project', $lang['dev_project']);
    $tpl->assign('style_project', $lang['style_project']);
    $tpl->assign('contribution', $lang['contribution']);
    $tpl->assign('interrelated', $lang['interrelated']);

    $tpl->assign('write_blog',  $lang['write_blog']);
    // 统计
    $result = $db->result("SELECT conf_value FROM " . $db->get_table(TB_CONF) . " WHERE conf_name='statistics_herf'");
    if (isset($result[0]['conf_value']) && $result[0]['conf_value'] != NULL) {
        $tpl->assign('tongji', sprintf($lang['look_tongji'], $result[0]['conf_value']));
    }
   // 标题状态
   $site = $db->result("SELECT conf_value FROM " . $db->get_table(TB_CONF) . " WHERE conf_name='site_title'");
    if (isset($site[0]['conf_value']) && $site[0]['conf_value'] != NULL) {
        $tpl->assign('site_title',  $site[0]['conf_value']);
    }
    // 所在位置
    $location_link = array("<a href='main.php'>" . $lang['1_home_page']['name'] . "</a>",
        "<a href='main.php'>" .  $lang['1_home_page']['global_set']. "</a>"
    );
    $tpl->assign('location_link', $location_link);
$tpl->display('main.html');
?>