2011-10-31 08:00:12 +00:00
|
|
|
<?
|
|
|
|
// Already done in /sections/ajax/index.php
|
|
|
|
//enforce_login();
|
|
|
|
|
|
|
|
if (!empty($LoggedUser['DisableForums'])) {
|
|
|
|
print json_encode(array('status' => 'failure'));
|
2012-02-09 08:00:20 +00:00
|
|
|
die();
|
2013-07-02 08:01:37 +00:00
|
|
|
} else {
|
2012-02-14 08:00:22 +00:00
|
|
|
// Replace the old hard-coded forum categories
|
2013-10-01 23:08:42 +00:00
|
|
|
$ForumCats = Forums::get_forum_categories();
|
2012-02-14 08:00:22 +00:00
|
|
|
|
2011-10-31 08:00:12 +00:00
|
|
|
//This variable contains all our lovely forum data
|
2013-10-01 23:08:42 +00:00
|
|
|
$Forums = Forums::get_forums();
|
2013-02-22 08:00:24 +00:00
|
|
|
|
2013-05-05 08:00:31 +00:00
|
|
|
if (empty($_GET['type']) || $_GET['type'] == 'main') {
|
2011-10-31 08:00:12 +00:00
|
|
|
include(SERVER_ROOT.'/sections/ajax/forum/main.php');
|
|
|
|
} else {
|
2013-05-01 08:00:16 +00:00
|
|
|
switch ($_GET['type']) {
|
2011-10-31 08:00:12 +00:00
|
|
|
case 'viewforum':
|
|
|
|
include(SERVER_ROOT.'/sections/ajax/forum/forum.php');
|
|
|
|
break;
|
|
|
|
case 'viewthread':
|
|
|
|
include(SERVER_ROOT.'/sections/ajax/forum/thread.php');
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
print json_encode(array('status' => 'failure'));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|