X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fsiteinserter.cpp;h=99a96c754bdebc55e17373d49473d9cc4307b3f7;hb=30c26abc85a6331fecdcb6b03813710bfbc63d3f;hp=77da44a9aa4b260ce09eac576314667cf8139dfd;hpb=dec33c63afafabf83c3039e916725cac6faef9b3;p=fms.git diff --git a/src/freenet/siteinserter.cpp b/src/freenet/siteinserter.cpp index 77da44a..99a96c7 100644 --- a/src/freenet/siteinserter.cpp +++ b/src/freenet/siteinserter.cpp @@ -44,8 +44,6 @@ std::string SiteInserter::GenerateIndex(const std::string &htmltemplate, const l { std::string content=""; - content+="

My last few posts

"; - SQLite3DB::Statement boardst=m_db->Prepare("SELECT tblBoard.BoardName FROM tblBoard INNER JOIN tblMessageBoard ON tblBoard.BoardID=tblMessageBoard.BoardID WHERE tblMessageBoard.MessageID=? ORDER BY tblBoard.BoardName COLLATE NOCASE;"); SQLite3DB::Statement st=m_db->Prepare("SELECT tblMessage.Body, tblMessage.Subject, tblMessage.MessageID FROM tblMessage INNER JOIN tblIdentity ON tblMessage.IdentityID=tblIdentity.IdentityID INNER JOIN tblLocalIdentity ON tblIdentity.PublicKey=tblLocalIdentity.PublicKey WHERE tblLocalIdentity.LocalIdentityID=? ORDER BY tblMessage.MessageDate DESC, tblMessage.MessageTime DESC LIMIT 0,10;"); st.Bind(0,localidentityid); @@ -166,10 +164,10 @@ void SiteInserter::GeneratePages(const long localidentityid, std::string &uskkey uskkey=key; filename=name+"-template.htm"; - FILE *infile=fopen(filename.c_str(),"r+b"); + FILE *infile=fopen(filename.c_str(),"rb"); if(!infile) { - infile=fopen("site-template.htm","r+b"); + infile=fopen("site-template.htm","rb"); } if(infile) { @@ -205,7 +203,7 @@ void SiteInserter::GeneratePages(const long localidentityid, std::string &uskkey // get extra files that the user wants to add to the Freesite filename=name+"-files.txt"; - infile=fopen(filename.c_str(),"r+b"); + infile=fopen(filename.c_str(),"rb"); if(infile) { std::vector files; @@ -228,7 +226,7 @@ void SiteInserter::GeneratePages(const long localidentityid, std::string &uskkey if((*i)!="" && (*i).find("index.htm")==std::string::npos && (*i).find("trustlist.htm")==std::string::npos && (*i).find("files.htm")==std::string::npos) { filename=(*i); - infile=fopen(filename.c_str(),"r+b"); + infile=fopen(filename.c_str(),"rb"); if(infile) { fseek(infile,0,SEEK_END); @@ -277,11 +275,11 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con st.Bind(1,Poco::DateTimeFormatter::format(date,"%Y-%m-%d %H:%M:%S")); st.Step(); - content+=""; - content+="
"; + content+=""; + content+=""; content+="Trust List of "+SanitizeOutput(name); content+=""; - content+=""; + content+=""; while(st.RowReturned()) { std::string idname=""; @@ -317,11 +315,11 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con content+=""; if(freesiteedition!="") { - content+=""; + content+=""; } else { - content+=""; + content+=""; } content+=""; content+=""; @@ -331,6 +329,7 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con st.Step(); } + content+="
Message TrustMessage CommentTrust List TrustTrust Comment
Message TrustMessage CommentTrust List TrustTrust Comment
"+SanitizeOutput(CreateShortIdentityName(idname,publickey))+""+SanitizeOutput(CreateShortIdentityName(idname,publickey))+"
"+SanitizeOutput(CreateShortIdentityName(idname,publickey))+"
"+messagetrust+""+SanitizeOutput(messagetrustcomment)+"
"; return StringFunctions::Replace(htmltemplate,"[CONTENT]",content);