$Smarty->assign('CSRFToken', Session::GenerateCSRFToken()); $Smarty->assign('TopicData', $TopicData); $Smarty->assign('Page', Page::Info('forum', array('bodycss' => 'forums view-topic logged-in', 'pagetitle' => $TopicData['topic']['name'] . ' - '))); $Smarty->display('pages/forums_view_topic'); } else { switch ($_REQUEST['datatype']) { case 'post': if (Session::ValidateCSRFToken($_REQUEST['csrftoken'])) { Text::Request(); } break; case 'up': Text::Request(); break; case 'report': Text::Request(); break; } } } elseif (Text::Match($_REQUEST['subcategory'], 'quote')) { echo Forums::QuotePost($_REQUEST['forumID'], $_REQUEST['topicID'], $_REQUEST['postID']); } else { Page::GenerateErrorPage($Smarty, 404); } } } break; default: header('Location: /'); break; }