<?php
/**
 * @version		1.0
 * @package		HonoWeb->HonoCMS
 * @copyright	Copyright (C) HonoWeb. All rights reserved.
 * @Website		www.honoweb.com.
 */
/* ======================================================================= */
//                             database define
/* ======================================================================= */
		//db
		$mysqlhost="{mysqlhost}"; //host name
		$mysqluser="{mysqluser}";              //login name
		$mysqlpwd="{mysqlpwd}";              //password
		$mysqldb="{mysqldb}";      //name of database
	
	
/* ======================================================================= */
//                             table define
/* ======================================================================= */
		$TablePre = 'hono_';
	//Authorization	 table
		$TableMenu=$TablePre."menu";
		$TableAdmin=$TablePre."users";
		$TableRole=$TablePre."role";
		$TableMenu_role=$TablePre."menu_role";
		$TableUser=$TablePre."users";
		$TableSite_category=$TablePre."site";
		$TableConfig=$TablePre."config";
	//bbs
		$TableBbs_category = $TablePre."bbs_category";
		$TableBbs_content = $TablePre."bbs_content";
		$TableBbs_answer = $TablePre."bbs_answer";
		$TableBbs_config =$TablePre."bbs_config";
		$TableBbs_link =$TablePre."bbs_link";
		
	
	//templates

		$TableBbs_templates=$TablePre."bbs_templates";
		
/* ---------------------------------------------------------------------- */

		define("_ACCESS_","ok");

/* ---------------------------------------------------------------------- */
		function getVirtualDirectory()
		{
			$returnvalue="";
			$current_dir=str_replace('\\','/',dirname(__FILE__));
			$DRoot=$_SERVER['DOCUMENT_ROOT'];
			if($current_dir==$DRoot)
				return $returnvalue;
			$current_dir_array=explode($DRoot,$current_dir);
			$returnvalue.=$current_dir_array[1];
			return $returnvalue;
			
		}
		
		$TitleName = "Website Administration - HonoBBS";  //<title></title>。
		$pagenum = 15;	  //page 15
		$WebHost=$_SERVER['HTTP_HOST'];	
		$SETUPFOLDER=getVirtualDirectory();
		$BASEPATH = dirname(__FILE__); 
		$UploadPath = $BASEPATH."/"; //file upload path
		$Site_No= "1";	  //website number
		$T_Bgcolor=array(1=>"#FBFDDB","#E3E3E3");
		$T_ToolbarSet="Basic";
		$T_FkDefaultLanguage="en";	
		$T_Fk_sBasePath=$SETUPFOLDER."/admin/fckeditor/";
		$T_Booklet_type =array(1=>"Text Link","Picture Link");
		//echo $RealPath;
		

/* ======================================================================= */
//                              parameter
/* ======================================================================= */	
		
		
		
		//信息
		$T_Is_YesNO= array(1=>"Yes","No");
		$T_Gender =array(1=>"Male","Female");
		$T_Avatar_Type =array(1=>"Upload","Embed","Default");
		
/* ======================================================================= */
	
//check install exsit
$Instail_dir=$BASEPATH."/install";
if(file_exists($Instail_dir))
{
	header("location: ".$SETUPFOLDER."/install");
	exit();
}

/* ======================================================================= */
		include $BASEPATH."/include/function.php";
		
		ini_set("session.use_cookies","1");
		session_start();
		import_request_variables("pg");
		error_reporting(7);
		error_reporting(E_ALL^(E_NOTICE|E_WARNING)); 
		ob_start();	
		
		//prevent injection 
		if ($_SERVER['QUERY_STRING'] != '' && !preg_match('/^(|[a-z&=0-9_]+)$/is', chop($_SERVER['QUERY_STRING']))) {
			exit("Restricted access!");
		}
?>