X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fhttp%2Ffmshttprequesthandlerfactory.cpp;h=c4606c061a7c46a2bc3b1588be6746f82ee39478;hb=221236a4d3aac4144529d418ce368db5c98facb0;hp=8d89baac0abb5aeda2da2a5d6b711c3bc19dd032;hpb=4855de56590e2f27d39036922339992c96bce9d1;p=fms.git
diff --git a/src/http/fmshttprequesthandlerfactory.cpp b/src/http/fmshttprequesthandlerfactory.cpp
index 8d89baa..c4606c0 100644
--- a/src/http/fmshttprequesthandlerfactory.cpp
+++ b/src/http/fmshttprequesthandlerfactory.cpp
@@ -17,12 +17,20 @@
#include "../../include/http/pages/peermaintenancepage.h"
#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()
{
// set template
std::string templatestr="
Home
Could not open template.htm! Place in program directory and restart!
[CONTENT]";
- FILE *infile=fopen("template.htm","r+b");
+ FILE *infile=fopen("template.htm","rb");
if(infile)
{
fseek(infile,0,SEEK_END);
@@ -38,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));
@@ -54,6 +80,14 @@ FMSHTTPRequestHandlerFactory::FMSHTTPRequestHandlerFactory()
m_pagehandlers.push_back(new PeerMaintenancePage(templatestr));
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));