$Smarty->display('pages/forums_list_categories'); } else { if (is_numeric($_REQUEST['subcategory'])) { if (Forums::CheckForumExistance($_REQUEST['subcategory'])) { if (Text::IsNull($_REQUEST['lastcategory'])) { $Topics = Forums::GetTopics($_REQUEST['subcategory']); if (Text::Match($Topics['topics'][0]['id'], '')) { $Topics['topics'] = array(); } $Smarty->assign('Forum', $Topics); $Smarty->assign('Page', Page::Info('forum', array('bodycss' => 'forums view-forum', 'pagetitle' => $Topics['forum_name'] . ' - '))); $Smarty->display('pages/forums_list_topics'); } else { if (Text::IsNull($_REQUEST['datatype'])) { if (Text::Match($_REQUEST['lastcategory'], 'topic')) { $Topics = Forums::GetTopics($_REQUEST['subcategory']); if (Text::Match($Topics['topics'][0]['id'], '')) { $Topics['topics'] = array(); } $Smarty->assign('CSRFToken', Session::GenerateCSRFToken()); $Smarty->assign('Forum', $Topics); $Smarty->assign('Page', Page::Info('forum', array('bodycss' => 'forums view-topic create-topic logged-in', 'pagetitle' => $Smarty->GetConfigVars('Forum_Create_New_Topic') . ' - ' . $Smarty->GetConfigVars('Forum_Page_Title') . ' - '))); $Smarty->display('forum/create_topic'); } else { Page::GenerateErrorPage($Smarty, 404); } } else { if (Text::Match($_REQUEST['datatype'], 'post')) { if (Session::ValidateCSRFToken($_REQUEST['csrftoken'])) { $TopicID = Forums::CreateTopic($_REQUEST['subcategory'], $SelectedCharacterForComments['name'], $_REQUEST['subject'], $_REQUEST['postCommand_detail']); header('Location: /forum/topic/' . $TopicID);