X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhttp%2Ffmshttprequesthandlerfactory.cpp;h=84952d295c11c7f6c85adfedd32e96016ab0012a;hb=e662ea47fba8715474851ceebacba400984ee433;hp=6adb09f2cff84608fe10ee6c859900f4ddd95ea3;hpb=822f84f5dac64183c556bd86fea8cd7b0527f528;p=fms.git
diff --git a/src/http/fmshttprequesthandlerfactory.cpp b/src/http/fmshttprequesthandlerfactory.cpp
index 6adb09f..84952d2 100644
--- a/src/http/fmshttprequesthandlerfactory.cpp
+++ b/src/http/fmshttprequesthandlerfactory.cpp
@@ -18,6 +18,11 @@
#include "../../include/http/pages/peertrustpage.h"
#include "../../include/http/pages/versioninfopage.h"
#include "../../include/http/pages/recentlyaddedpage.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 +44,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 +79,11 @@ 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 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));