<?php
/**
 * @version		1.0
 * @package		HonoWeb->HonoCart
 * @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";
	//system config
		$TableConfig =$TablePre."config";
		
	
	//article
		$TableInfo_category=$TablePre."menuitem";
		$TableInfos=$TablePre."infos";
		$TableModules=$TablePre."modules";
		$TableTemplates=$TablePre."templates";
		$TableMain_menu=$TablePre."mainmenu";
		$TablePoll = $TablePre."poll";
		$TableLink = $TablePre."link";
		$TableAdvertisement = $TablePre."advertisement";
		$TableBoard = $TablePre."board";
		$TableBoard_answer = $TablePre."board_answer";
		$TableQa = $TablePre."qa";
		$TableContact = $TablePre."contact";
		
/* ---------------------------------------------------------------------- */

		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 - CMS";  //<title></title>。
		$pagenum = 15;	  //page 15
		$WebHost=$_SERVER['HTTP_HOST'];	
		$SETUPFOLDER=getVirtualDirectory();
		$BASEPATH = dirname(__FILE__); 
		$UploadPath = $BASEPATH."/"; //file upload path
		$HostUrl =  "http://".$WebHost."/";
		$Site_No= "1";	  //website number
		$dispatch_page= "index.php";
		$T_Page_Level =array(1=>"Home Page","Second Page","Third Page","Fourth Page");
		$T_Module_Position =array(1=>"None","HomePage Left","HomePage Center","HomePage Right","SubPage","ProfilePage");
		$T_Bgcolor=array(1=>"#FBFDDB","#E3E3E3");
		$T_Editor_type=array(1=>"Text","oFCKeditor","eWebeditor");
		$T_ToolbarSet="Basic";
		$T_FkDefaultLanguage="en";	
		$T_Fk_sBasePath=$SETUPFOLDER."/admin/fckeditor/";
		$T_Booklet_type =array(1=>"Text Link","Picture Link");
		$T_Advertisement_Type =array(1=>"Home Left","Home Center","Home Right","Home Top","Home Bottom");
		//echo $RealPath;
		

/* ======================================================================= */
//                              parameter
/* ======================================================================= */	
		
		
		
		//信息
		$T_Is_YesNO= array(1=>"Yes","No");
		$T_Gender =array(1=>"Male","Female");
		$T_Avatar_Type =array(1=>"Upload","Embed","Default");
		$T_Link_method =array(1=>"_top","_parent","_blank");
		$T_Upload_Type =array(1=>"Picture","File","Media");
		$T_Dispach =array(1=>"Index","Profile");
		$T_Dispach_Page =array(1=>"index.php","profile.php");
		$T_Access_Level =array(1=>"Public","Registed","Special");
	

/* ======================================================================= */
	
//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!");
		}
?>