Files
uf2/index.php
PioDer a542813c8f implemented buildURL() function (and fixed redirecting on https page)
added comments block (file description) in each PHP file
2015-02-15 14:33:02 +01:00

52 lines
1.2 KiB
PHP

<?php
/**
* @package uForum2
* @file index.php
* @copyright 2007-2015 (c) PioDer <piotrek@pioder.pl>
* @link http://www.pioder.pl/
* @license see LICENSE.txt
**/
$_GET['mode'] = (isset($_GET['mode'])) ? trim(strip_tags($_GET['mode'])) : '';
$_GET['submode'] = (isset($_GET['submode'])) ? trim(strip_tags($_GET['submode'])) : '';
require_once('./config.php');
require_once('./inc/constants.php');
require_once('./inc/database_connection.php');
require_once('./inc/bbcode.php');
require_once('./inc/misc_functions.php');
try
{
switch ($_GET['mode'])
{
default:
require_once('./inc/controllers/MainController.class.php');
$ob = new MainController($DB);
if ($_GET['mode'] != null)
$ob->$_GET['mode']();
else
$ob->loadDefault();
break;
case 'admin':
require_once('./inc/controllers/AdminController.class.php');
$ob = new AdminController($DB);
if ($_GET['submode'] != null)
$ob->$_GET['submode']();
else
$ob->loadDefault();
break;
}
}
catch (Exception $e)
{
echo
'<span style="color: red">Unexpected error occured:<br>
<span style="font-weight: bold">'.$e->getMessage().'</span><br>
<br>
File: '.$e->getFile().'<br>
Line: '.$e->getLine().'<br>
Trace: '.$e->getTraceAsString().'</span>';
exit;
}
?>