version 0.2.20
[fms.git] / src / freenet / siteinserter.cpp
index f7d9ef2..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
@@ -91,8 +95,7 @@ std::string SiteInserter::GenerateIndex(const std::string &htmltemplate, const l
                st.Step();\r
        }\r
 \r
-       std::string output=StringFunctions::Replace(htmltemplate,"[CONTENT]",content);\r
-       return StringFunctions::Replace(output,"[IDENTITYNAME]",SanitizeOutput(name));\r
+       return StringFunctions::Replace(htmltemplate,"[CONTENT]",content);\r
 \r
 }\r
 \r
@@ -173,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