require('config/config.inc.php'); require('include/cms_main.class.inc.php'); require('include/simpledatabase.class.inc.php'); require('include/ui.inc.php'); // Language Selection if($_GET['lang'] == 'zh' || $_GET['lang'] == 'en'){ $_SESSION['lang'] = $_GET['lang']; } if(!isset($_SESSION['lang'])){ $_SESSION['lang'] = 'zh'; } require('./include/lang/' . $_SESSION['lang'] . '.inc.php'); // Initial CMS Tree $tree = new CMSMain(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB, 'index' , Array('name') ); $settings = new SimpleDatabase(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB, 'site_settings'); // If page not exist, redirect to home //$id = 0; $id = (isset($tree->tree[ 'level'][ $_GET['id'] ]) ? $_GET['id'] : 0) ; // Page Stats $tree->addHit($id); // Process redirects if(!empty($tree->tree['redirect'][$id])){ header("Location: " . $tree->tree['redirect'][$id]); die(); } $title = (!empty($tree->tree['name'][$id]) ? $tree->tree['name'][$id] : '首頁'); ?> pasteHeader($title ,Array('css/main.css') )?>