<?php
|
|
/**
|
|
* @package uForum2
|
|
* @file index.php
|
|
* @copyright 2007-2015 (c) PioDer
|
|
* @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;
|
|
}
|
|
?>
|