54 lines
2.2 KiB
PHP
Executable File
54 lines
2.2 KiB
PHP
Executable File
<?php
|
|
#########################################################
|
|
# #
|
|
# control file for entire pae.co.at site #
|
|
# written by benjamin ramey #
|
|
# bsr@rameydesign.net #
|
|
# #
|
|
# best viewed with: #
|
|
# resolution = 1280x960 #
|
|
# tab = 4 spaces #
|
|
# indent = 8 spaces #
|
|
# #
|
|
########################################################################################## site initialization
|
|
session_start(); // we will use sessions for certain things
|
|
include 'includes/constants.php'; // the constants we want!
|
|
include 'includes/includes.php'; // not allowed to print anything
|
|
include 'includes/globals.php'; // all my global variables
|
|
|
|
if($_LANG === NULL) { // if there is no language prefix in the url
|
|
if(isset($_COOKIE['paelang'])) { // check for a cookie. if the cookie exists
|
|
header('Location: '.$_PATH_PREFIX.'/'.$_COOKIE['paelang']); // redirect the viewer to the intro page of that language
|
|
}
|
|
else { // if the cookie does not exist, redirect the viewer to
|
|
include 'html/html_langchoice.php'; // the language choice page and exit
|
|
exit;
|
|
}
|
|
}
|
|
else if(!isset($_COOKIE['paelang'])) { // if a language is selected, but not cookie has been
|
|
$ten_years = time() + 60*60*24*365*10; // ten years from the current time
|
|
setcookie('paelang',$_LANG,$ten_years,'/',$_CONFIG['cookie_domain']); // set yet, then set the cookie for future use
|
|
$_COOKIE['paelang'] = $_LANG;
|
|
}
|
|
else if($_COOKIE['paelang'] !== $_LANG) {
|
|
$ten_years = time() + 60*60*24*365*10;
|
|
setcookie('paelang',$_LANG,$ten_years,'/',$_CONFIG['cookie_domain']);
|
|
}
|
|
|
|
include $_DOC_ROOT."/includes/globals_{$_LANG}.php"; // include the language specific globals
|
|
|
|
########################################################################################## site displaying
|
|
switch($_CMDS['cmd']) { // main control structure
|
|
case 'display':
|
|
html_switchboard();
|
|
break;
|
|
case 'user':
|
|
users_switchboard();
|
|
break;
|
|
default:
|
|
$_CMDS['cmd'] = 'display';
|
|
$_CMDS['query'] = array('home');
|
|
html_switchboard();
|
|
break;
|
|
}
|
|
?>
|