version 0.3.26
[fms.git] / src / freenet / siteinserter.cpp
index 77da44a..99a96c7 100644 (file)
@@ -44,8 +44,6 @@ std::string SiteInserter::GenerateIndex(const std::string &htmltemplate, const l
 {\r
        std::string content="";\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
        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;");\r
        st.Bind(0,localidentityid);\r
@@ -166,10 +164,10 @@ void SiteInserter::GeneratePages(const long localidentityid, std::string &uskkey
                uskkey=key;\r
 \r
                filename=name+"-template.htm";\r
-               FILE *infile=fopen(filename.c_str(),"r+b");\r
+               FILE *infile=fopen(filename.c_str(),"rb");\r
                if(!infile)\r
                {\r
-                       infile=fopen("site-template.htm","r+b");\r
+                       infile=fopen("site-template.htm","rb");\r
                }\r
                if(infile)\r
                {\r
@@ -205,7 +203,7 @@ void SiteInserter::GeneratePages(const long localidentityid, std::string &uskkey
 \r
                // get extra files that the user wants to add to the Freesite\r
                filename=name+"-files.txt";\r
-               infile=fopen(filename.c_str(),"r+b");\r
+               infile=fopen(filename.c_str(),"rb");\r
                if(infile)\r
                {\r
                        std::vector<std::string> files;\r
@@ -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)\r
                                {\r
                                        filename=(*i);\r
-                                       infile=fopen(filename.c_str(),"r+b");\r
+                                       infile=fopen(filename.c_str(),"rb");\r
                                        if(infile)\r
                                        {\r
                                                fseek(infile,0,SEEK_END);\r
@@ -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"));\r
        st.Step();\r
 \r
-       content+="<table>";\r
-       content+="<tr><th colspan=\"5\">";\r
+       content+="<table class=\"trustlist\">";\r
+       content+="<tr class=\"title\"><thcolspan=\"5\">";\r
        content+="Trust List of "+SanitizeOutput(name);\r
        content+="</th></tr>";\r
-       content+="<tr><td></td><th>Message Trust</th><th>Message Comment</th><th>Trust List Trust</th><th>Trust Comment</th></tr>";\r
+       content+="<tr class=\"headings\"><th></th><th>Message Trust</th><th>Message Comment</th><th>Trust List Trust</th><th>Trust Comment</th></tr>";\r
        while(st.RowReturned())\r
        {\r
                std::string idname="";\r
@@ -317,11 +315,11 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con
                content+="<tr>";\r
                if(freesiteedition!="")\r
                {\r
-                       content+="<td><a href=\""+uskkey+"\">"+SanitizeOutput(CreateShortIdentityName(idname,publickey))+"</a></td>";\r
+                       content+="<td><div><a href=\""+uskkey+"\">"+SanitizeOutput(CreateShortIdentityName(idname,publickey))+"</a></div></td>";\r
                }\r
                else\r
                {\r
-                       content+="<td>"+SanitizeOutput(CreateShortIdentityName(idname,publickey))+"</td>";\r
+                       content+="<td><div>"+SanitizeOutput(CreateShortIdentityName(idname,publickey))+"</div></td>";\r
                }\r
                content+="<td "+GetClassString(messagetrust)+">"+messagetrust+"</td>";\r
                content+="<td>"+SanitizeOutput(messagetrustcomment)+"</td>";\r
@@ -331,6 +329,7 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con
 \r
                st.Step();\r
        }\r
+       content+="</table>";\r
 \r
        return StringFunctions::Replace(htmltemplate,"[CONTENT]",content);\r
 \r