<?
session_start();
include_once('config.inc.php');
include_once('include/adodb/adodb.inc.php');
include_once('include/adodb/adodb-pager.inc.php');
require_once('include/adodb/adodb-active-record.inc.php');
include_once('include/phptimer/class.phpTimer.php');
include_once('include/fckeditor/fckeditor.php') ;
$cfg['url']=$cfg_url;
$cfg['title']=$cfg_title;
$cfg['theme']=$cfg_theme;
$cfg['lang']=$cfg_lang;
$cfg['dir']=$cfg_dir;
$cfg['datadir']=$cfg_datadir;
$cfg['packdir']=$cfg_packagedir;
$cfg['tablepre']=$tablepre;
$cfg['log']=$cfg_log;
$cfg['email']=$cfg_email;
$cfg['sendmail']=$cfg_sendmail;
$cfg['smtp_host']=$cfg_smtp_host;
$cfg['smtp_port']=$cfg_smtp_port;
$cfg['offset_time']=$cfg_offsettime;
$ADODB_CACHE_DIR=$cfg['datadir']."/cache/";
$db=&ADONewConnection($dbtype);
$db->NConnect($dbhost, $dbuser, $dbpw, $dbname);
/*$charset = "SET NAMES 'utf8'"; */
/*$charset = "SET character_set_results=utf8"; */
/*$db->query($charset);*/
// load syslanai
include_once('include/lanai/class.system.php');
include_once('include/lanai/class.html.php');
include_once('include/lanai/class.pager.php');
$sys_lanai=new Systems();
// offline
if (($cfg_off=="yes") AND ($offpage!="yes") AND (!eregi("setting.php", $_SERVER['PHP_SELF']))) {
$sys_lanai->go2Page("offline.php");
}
// load sys lang
if (($loadlang=="yes") OR (empty($loadlang))) {
if (file_exists("language/lang-".$cfg_lang.".php")) {
include_once("language/lang-".$cfg_lang.".php");
} else {
include_once("language/lang-english.php");
}
}
// sys theme
if (file_exists("theme/".$cfg_theme."/theme.php")) {
include_once("theme/".$cfg_theme."/theme.php");
} else {
$cfg_theme="default";
include_once("theme/".$cfg_theme."/theme.php");
}
// smarty
# changes this value according to your uploaded smarty distribution.
# don't forget to add trailing back slash
# change 'username' to your username on web hosting account
define ("SMARTY_DIR", "include/smarty/");
require_once (SMARTY_DIR."Smarty.class.php");
$smarty = new Smarty;
$smarty->compile_dir = $cfg['datadir']."/cache";
$smarty->template_dir = "theme/".$cfg_theme."/html";
$smarty->assign("cfgTheme", $cfg_theme);
// parse request value
/*
$INPUT= array();
foreach ($_GET as $_var=>$_val) $INPUT[$_var]= $_val;
foreach ($_POST as $_var=>$_val) $INPUT[$_var]= $_val;
foreach ($_COOKIE as $_var=>$_val) $INPUT[$_var]= $_val;
*/
// load meta
include_once("modules/config/module.php");
$obMeta=new Meta();
$obMeta->Load("mtaId=1");
if ($cfg['log']=='yes') {
if (file_exists("modules/log/module.php")) {
include_once("modules/log/module.php");
$obsyslog=new SysLog();
$obsyslog->setLog();
unset($obsyslog);
}
}
?>