X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Fhttp%2Ffmshttprequesthandlerfactory.cpp;h=c4606c061a7c46a2bc3b1588be6746f82ee39478;hp=6adb09f2cff84608fe10ee6c859900f4ddd95ea3;hb=221236a4d3aac4144529d418ce368db5c98facb0;hpb=d5c9f7e6c1dd263dfc85a3cb5941a378a5ddd923 diff --git a/src/http/fmshttprequesthandlerfactory.cpp b/src/http/fmshttprequesthandlerfactory.cpp index 6adb09f..c4606c0 100644 --- a/src/http/fmshttprequesthandlerfactory.cpp +++ b/src/http/fmshttprequesthandlerfactory.cpp @@ -18,6 +18,13 @@ #include "../../include/http/pages/peertrustpage.h" #include "../../include/http/pages/versioninfopage.h" #include "../../include/http/pages/recentlyaddedpage.h" +#include "../../include/http/pages/browseboardspage.h" +#include "../../include/http/pages/browsemessagespage.h" +#include "../../include/http/pages/forummainpage.h" +#include "../../include/http/pages/showimagepage.h" +#include "../../include/http/pages/forumthreadspage.h" +#include "../../include/http/pages/forumviewthreadpage.h" +#include "../../include/http/pages/forumcreatepostpage.h" FMSHTTPRequestHandlerFactory::FMSHTTPRequestHandlerFactory() { @@ -39,6 +46,24 @@ FMSHTTPRequestHandlerFactory::FMSHTTPRequestHandlerFactory() m_log->error("HTTPThread::HTTPThread could not open template.htm"); } + // load forum template + std::string forumtemplate="Home

Could not open forum-template.htm! Place in program directory and restart!


[CONTENT]"; + infile=fopen("forum-template.htm","rb"); + if(infile) + { + fseek(infile,0,SEEK_END); + long len=ftell(infile); + std::vector data(len,0); + fseek(infile,0,SEEK_SET); + fread(&data[0],1,len,infile); + fclose(infile); + forumtemplate.assign(data.begin(),data.end()); + } + else + { + m_log->error("HTTPThread::HTTPThread could not open forum-template.htm"); + } + // push back page handlers m_pagehandlers.push_back(new OptionsPage(templatestr)); m_pagehandlers.push_back(new CreateIdentityPage(templatestr)); @@ -56,6 +81,13 @@ FMSHTTPRequestHandlerFactory::FMSHTTPRequestHandlerFactory() m_pagehandlers.push_back(new PeerTrustPage(templatestr)); m_pagehandlers.push_back(new VersionInfoPage(templatestr)); m_pagehandlers.push_back(new RecentlyAddedPage(templatestr)); + m_pagehandlers.push_back(new BrowseBoardsPage(templatestr)); + m_pagehandlers.push_back(new BrowseMessagesPage(templatestr)); + m_pagehandlers.push_back(new ShowImagePage()); + m_pagehandlers.push_back(new ForumMainPage(forumtemplate)); + m_pagehandlers.push_back(new ForumThreadsPage(forumtemplate)); + m_pagehandlers.push_back(new ForumViewThreadPage(forumtemplate)); + m_pagehandlers.push_back(new ForumCreatePostPage(forumtemplate)); // homepage must be last - catch all page handler m_pagehandlers.push_back(new HomePage(templatestr));