{\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
{\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
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
std::string publishboardliststr="";\r
bool publishtrustlist=false;\r
bool publishboardlist=false;\r
+ std::string editionstr="";\r
\r
st.ResultText(0,name);\r
st.ResultText(1,key);\r
st.ResultText(2,publishtrustliststr);\r
st.ResultText(3,publishboardliststr);\r
+ st.ResultText(4,editionstr);\r
\r
publishtrustliststr=="true" ? publishtrustlist=true : publishtrustlist=false;\r
publishboardliststr=="true" ? publishboardlist=true : publishboardlist=false;\r
+ // no edition exists - start at 0\r
+ if(editionstr=="")\r
+ {\r
+ editionstr="0";\r
+ }\r
+ // previous edition exists - add 1\r
+ else\r
+ {\r
+ int edition=0;\r
+ StringFunctions::Convert(editionstr,edition);\r
+ edition++;\r
+ StringFunctions::Convert(edition,editionstr);\r
+ }\r
\r
filename=name+"-template.htm";\r
FILE *infile=fopen(filename.c_str(),"r+b");\r
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
key.erase(0,3);\r
key="USK"+key;\r
}\r
- key+=m_messagebase+"/0/";\r
+ key+=m_messagebase+"/"+editionstr+"/";\r
uskkey=key;\r
\r
}\r
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
\r
m_inserting.push_back(localidentityid);\r
\r
+ return true;\r
+\r
}\r