Exemple #1
0
                 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);
                     } else {
                         header('Location: ' . $_SERVER['HTTP_REFERER']);
                     }
                 } else {
                     Page::GenerateErrorPage($Smarty, 404);
                 }
             }
         }
     } else {
         Page::GenerateErrorPage($Smarty, 404);
     }
 } else {
     if (Text::Match($_REQUEST['subcategory'], 'topic')) {
         if (Text::IsNull($_REQUEST['datatype'])) {