version 0.2.20
[fms.git] / src / freenet / siteinserter.cpp
index df4831c..e54a28e 100644 (file)
@@ -22,6 +22,10 @@ void SiteInserter::CheckForNeededInsert()
        {\r
                DateTime date;\r
                date.SetToGMTime();\r
+               date.SetHour(0);\r
+               date.SetMinute(0);\r
+               date.SetSecond(0);\r
+               date.Normalize();\r
 \r
                SQLite3DB::Statement st=m_db->Prepare("SELECT LocalIdentityID FROM tblLocalIdentity WHERE PublishFreesite='true' AND (LastInsertedFreesite IS NULL OR LastInsertedFreesite<?);");\r
                st.Bind(0,date.Format("%Y-%m-%d"));\r
@@ -40,8 +44,6 @@ std::string SiteInserter::GenerateIndex(const std::string &htmltemplate, const l
 {\r
        std::string content="";\r
 \r
-       content="<h2>FMS site of "+SanitizeOutput(name)+"</h2>";\r
-\r
        content+="<h3>My last few posts</h3>";\r
 \r
        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;");\r
@@ -84,6 +86,9 @@ std::string SiteInserter::GenerateIndex(const std::string &htmltemplate, const l
                content+="</div>";\r
                content+="<div class=\"postbody\">";\r
                content+=SanitizeOutput(post);\r
+               //post=SanitizeOutput(post);\r
+               //StringFunctions::Replace(post,"\r\n","<br>");\r
+               //content+=post;\r
                content+="</div>";\r
                content+="</div>";\r
 \r
@@ -171,6 +176,7 @@ void SiteInserter::GeneratePages(const long localidentityid, std::string &uskkey
                        htmltemplate.append(data.begin(),data.end());\r
 \r
                        htmltemplate=StringFunctions::Replace(htmltemplate,"[LINKS]",GenerateLinks(publishtrustlist,publishboardlist));\r
+                       htmltemplate=StringFunctions::Replace(htmltemplate,"[IDENTITYNAME]",SanitizeOutput(name));\r
 \r
                        pages["index.htm"]=GenerateIndex(htmltemplate,localidentityid,name);\r
                        if(publishtrustlist)\r
@@ -414,7 +420,7 @@ const std::string SiteInserter::SanitizeOutput(const std::string &input)
        return output;\r
 }\r
 \r
-void SiteInserter::StartInsert(const long &localidentityid)\r
+const bool SiteInserter::StartInsert(const long &localidentityid)\r
 {\r
        FCPMessage message;\r
        std::string localidentityidstr="";\r
@@ -458,4 +464,6 @@ void SiteInserter::StartInsert(const long &localidentityid)
 \r
        m_inserting.push_back(localidentityid);\r
 \r
+       return true;\r
+\r
 }\r