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

$debug = false;
if (!$debug) error_reporting(7);
require_once('admin/mysql.php');
require_once('class/ubb.php');
require_once('admin/functions.php');
require_once('admin/class/mysql.php');
require_once('admin/class/chinese.php');
require_once('admin/cache.php');



$DB = new DB_MySQL;
//连接MYSQL
$mysql = $DB->connect($mysql_add,$mysql_user,$mysql_pass,$mysql_dbname);
$config = $DB->fetch_one_array("SELECT * FROM `".$mysql_prefix."config`");

//选项
$articleNum		= 300;					//文章截取字数
$charset 			= "UTF-8";				//系统编码
$delay_time		= 15;					//评论/留言输入错误或判断为spam的请求 的延时
$config['submit_wait_time'] = 3;					//评论/留言提交成功后等待的时间（建议1-5）(单位 秒)


define('CHARSET',$charset);
if (!defined('HTML'))  header("content-type:text/html; charset=".$charset);








//定义O-BLOG
define("BLOG", "INOBLOG");
$var = "2.6";

//配置参数

$blogurl = trim($config['blogurl']);
$makehtml = intval($config['makehtml']);
$index_show_number = intval($config['index_show_number']);
$discribe = trim($config['blogdescribe']);
$TemplateName = trim($config['template']);
$blogName = trim($config['blogname']);
$showNum = intval($config['lastblog']);
$gb_show_num = intval($config['gb_show_num']);
$fullarticle = intval($config['fullarticle']);
$max_gb_char = intval($config['max_gb_char']);
$date_format = trim($config['date_format']);
$date_format_remark = trim($config['date_format_remark']);
$date_format_gb = trim($config['date_format_gb']);
$banned_username = split_word($config['banned_username']);
$banned_word = split_word($config['banned_word']);
$banned_ip = split_word($config['banned_ip']);
$post_gb_time = intval($config['post_gb_time']);
$search_time = intval($config['search_time']);
$close_blog = intval($config['close_blog']);
$show_viewcount = intval($config['show_viewcount']);
$close_reason = nl2br(trim($config['close_reason']));
$extraname = trim($config['extraname']);
$keep_page_way = trim($config['keep_page_way']);
$archive_folder = trim($config['archive_folder']);
$lastblog_cut_char = intval($config['lastblog_cut_char']);
$servertimezone = trim($config['servertimezone']);
$clienttimezone = trim($config['clienttimezone']);
$private_code = trim($config['private_code']);
$allow_trackback = trim($config['allow_trackback']);

if (!$private_code) $private_code = date('Y n');

$static_blog_name = $blogName;


//加载模板类
require_once("admin/class/template/class.smarttemplate.php");
if (!function_exists('template'))
{
function template($name)
{
	global $TemplateName;
	Return new SmartTemplate('templates/'.$TemplateName.'/'.$name.'.htm');
}
}

function get_input($name)
{
	global $private_code;
	return $name.md5($private_code.$name);
}

//获得当前日期
$week_n = obdate("w",time());
$week = array('星期日','星期一','星期二','星期三','星期四','星期五','星期六');
$today = obdate("Y 年 n 月 j 日 $week[$week_n]",time());

//加载自定义模板变量
$r = $DB->query("SELECT * FROM `".$mysql_prefix."ads` WHERE tag_open='1'");
$ads = array();
while($ad = $DB->fetch_array($r))
{
	$ads[$ad['tag']] = $ad['content'];
}

//加载自定义config
require_once('admin/config/navigator.php');
?>