X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=include%2Fhttp%2Fpages%2Fforumpage.h;fp=include%2Fhttp%2Fpages%2Fforumpage.h;h=3124b9e64e1e099a6f3b24788071eb12a7b1cc35;hp=0000000000000000000000000000000000000000;hb=221236a4d3aac4144529d418ce368db5c98facb0;hpb=d5c9f7e6c1dd263dfc85a3cb5941a378a5ddd923 diff --git a/include/http/pages/forumpage.h b/include/http/pages/forumpage.h new file mode 100644 index 0000000..3124b9e --- /dev/null +++ b/include/http/pages/forumpage.h @@ -0,0 +1,52 @@ +#ifndef _forumpage_ +#define _forumpage_ + +#include "../ipagehandler.h" +#include "../../idatabase.h" + +class ForumPage:public IPageHandler,public IDatabase +{ +public: + ForumPage(const std::string &templatestr, const std::string &pagename):IPageHandler(templatestr,pagename) {} + + virtual IPageHandler *New()=0; // returns a new instance of the object + +protected: + const std::string FixFromName(const std::string &fromname) + { + std::string tempname=fromname; + if(tempname.size()>30) + { + tempname.erase(27); + tempname+="..."; + } + tempname=SanitizeOutput(tempname); + return tempname; + } + + const std::string FixSubject(const std::string &subject) + { + std::string tempsubject=subject; + if(tempsubject.size()>30) + { + tempsubject.erase(27); + tempsubject+="..."; + } + tempsubject=SanitizeOutput(tempsubject); + return tempsubject; + } + + const std::string CreateForumHeader() + { + std::string content="\r\n"; + content+="\r\n"; + content+="
Home | Browse Forums
\r\n"; + return content; + } + +private: + virtual const std::string GeneratePage(const std::string &method, const std::map &queryvars)=0; + +}; + +#endif // _forumpage_