\r
#define VERSION_MAJOR "0"\r
#define VERSION_MINOR "3"\r
-#define VERSION_RELEASE "17"\r
+#define VERSION_RELEASE "18"\r
#define FMS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_RELEASE\r
+#define FMS_FREESITE_USK "USK@0npnMrqZNKRCRoGojZV93UNHCMN-6UU3rRSAmP6jNLE,~BG-edFtdCC1cSH4O3BWdeIYa8Sw5DfyrSV-TKdO5ec,AQACAAE/fms/78/"\r
+#define FMS_VERSION_EDITION "19"\r
\r
typedef Poco::ScopedLock<Poco::FastMutex> Guard;\r
\r
m_messagecount=0;\r
m_addedmethod="";\r
\r
- SQLite3DB::Statement st=m_db->Prepare("SELECT BoardName, BoardDescription, DateAdded, HighMessageID, LowMessageID, MessageCount, SaveReceivedMessages, AddedMethod FROM tblBoard LEFT JOIN vwBoardStats ON tblBoard.BoardID=vwBoardStats.BoardID WHERE tblBoard.BoardID=?;");\r
+ // Optimize query by not using vwBoardStats\r
+ //SQLite3DB::Statement st=m_db->Prepare("SELECT BoardName, BoardDescription, DateAdded, HighMessageID, LowMessageID, MessageCount, SaveReceivedMessages, AddedMethod FROM tblBoard LEFT JOIN vwBoardStats ON tblBoard.BoardID=vwBoardStats.BoardID WHERE tblBoard.BoardID=?;");\r
+ SQLite3DB::Statement st=m_db->Prepare("SELECT BoardName, BoardDescription, DateAdded, IFNULL(MAX(MessageID),'0') AS HighMessageID, IFNULL(MIN(MessageID),'0') AS LowMessageID, COUNT(MessageID) AS MessageCount, SaveReceivedMessages, AddedMethod FROM tblBoard LEFT JOIN tblMessageBoard ON tblBoard.BoardID=tblMessageBoard.BoardID WHERE tblBoard.BoardID=? AND (MessageID IS NULL OR MessageID>=0);");\r
st.Bind(0,boardid);\r
st.Step();\r
\r
int tempint=-1;\r
m_addedmethod="";\r
\r
- SQLite3DB::Statement st=m_db->Prepare("SELECT BoardName, BoardDescription, DateAdded, HighMessageID, LowMessageID, MessageCount, SaveReceivedMessages, tblBoard.BoardID, AddedMethod FROM tblBoard LEFT JOIN vwBoardStats ON tblBoard.BoardID=vwBoardStats.BoardID WHERE tblBoard.BoardName=?;");\r
+ // Optimize query by not using vwBoardStats\r
+ //SQLite3DB::Statement st=m_db->Prepare("SELECT BoardName, BoardDescription, DateAdded, HighMessageID, LowMessageID, MessageCount, SaveReceivedMessages, tblBoard.BoardID, AddedMethod FROM tblBoard LEFT JOIN vwBoardStats ON tblBoard.BoardID=vwBoardStats.BoardID WHERE tblBoard.BoardName=?;");\r
+ SQLite3DB::Statement st=m_db->Prepare("SELECT BoardName, BoardDescription, DateAdded, IFNULL(MAX(MessageID),'0') AS HighMessageID, IFNULL(MIN(MessageID),'0') AS LowMessageID, COUNT(MessageID) AS MessageCount, SaveReceivedMessages, tblBoard.BoardID, AddedMethod FROM tblBoard LEFT JOIN tblMessageBoard ON tblBoard.BoardID=tblMessageBoard.BoardID WHERE tblBoard.BoardName=? AND (MessageID IS NULL OR MessageID>=0);");\r
st.Bind(0,boardname);\r
st.Step();\r
\r
\r
db->Open("fms.db3");\r
db->SetBusyTimeout(20000); // set timeout to 20 seconds\r
+ db->Execute("PRAGMA synchronous = FULL;");\r
\r
db->Execute("CREATE TABLE IF NOT EXISTS tblDBVersion(\\r
Major INTEGER,\\r
// rotate and skew the big bitmap a few times\r
int lastrot=0;\r
int thisrot=0;\r
- int numrots=(rand()%4)+4;\r
+ int numrots=(rand()%3)+4;\r
for(int i=0; i<numrots; i++)\r
{\r
thisrot=((rand()%180)-90);\r
bigbmp.Rotate(-lastrot+thisrot,0,0,150,150);\r
int offset=rand()%10000;\r
- float freq=3.0+(float(rand()%7000)/1000.0);\r
- float amp=1.0+(float(rand()%1000)/500.0);\r
+ float freq=5.0+(float(rand()%7000)/1000.0);\r
+ float amp=1.0+(float(rand()%500)/500.0);\r
for(int y=0; y<bigbmp.Height(); y++)\r
{\r
double shift=sin((double)(y+offset)/freq)*amp;\r
#include "../../../../include/freenet/captcha/freeimage/bitmap.h"\r
\r
#include <cmath>\r
+#include <cstdlib>\r
\r
namespace FreeImage\r
{\r
\r
if(showgenericupdate)\r
{\r
- content+="Check for new versions at the <a href=\"http://"+fcphost+":"+fproxyport+"/USK@0npnMrqZNKRCRoGojZV93UNHCMN-6UU3rRSAmP6jNLE,~BG-edFtdCC1cSH4O3BWdeIYa8Sw5DfyrSV-TKdO5ec,AQACAAE/fms/76/\">FMS Freesite</a><br>";\r
+ content+="Check for new versions at the <a href=\"http://"+fcphost+":"+fproxyport+"/"+FMS_FREESITE_USK+"\">FMS Freesite</a><br>";\r
}\r
\r
content+="Use these pages to administer your FMS installation.";\r
\r
SQLite3DB::Statement st=m_db->Prepare("SELECT LocalIdentityID,tblLocalIdentity.Name,tblLocalIdentity.PublicKey,tbLLocalIdentity.PublishTrustList,tblLocalIdentity.SingleUse,tblLocalIdentity.PublishBoardList,tblIdentity.IdentityID,tblLocalIdentity.PublishFreesite,tblLocalIdentity.MinMessageDelay,tblLocalIdentity.MaxMessageDelay FROM tblLocalIdentity LEFT JOIN tblIdentity ON tblLocalIdentity.PublicKey=tblIdentity.PublicKey ORDER BY tblLocalIdentity.Name;");\r
st.Step();\r
+ SQLite3DB::Statement st2=m_db->Prepare("SELECT IdentityID FROM tblIdentity WHERE PublicKey=?;");\r
\r
SQLite3DB::Statement trustst=m_db->Prepare("SELECT COUNT(*) FROM tblPeerTrust LEFT JOIN tblIdentity ON tblPeerTrust.TargetIdentityID=tblIdentity.IdentityID WHERE tblIdentity.PublicKey=? GROUP BY tblPeerTrust.TargetIdentityID;");\r
\r
std::string publishfreesite="";\r
std::string minmessagedelay="0";\r
std::string maxmessagedelay="0";\r
+ std::string identityidstr="";\r
\r
st.ResultText(0,id);\r
st.ResultText(1,name);\r
st.ResultText(8,minmessagedelay);\r
st.ResultText(9,maxmessagedelay);\r
\r
+ st2.Bind(0,publickey);\r
+ st2.Step();\r
+ if(st2.RowReturned())\r
+ {\r
+ st2.ResultText(0,identityidstr);\r
+ }\r
+ st2.Reset();\r
+\r
content+="<tr>";\r
- content+="<td title=\""+publickey+"\"><form name=\"frmupdate\""+countstr+"\" method=\"POST\"><input type=\"hidden\" name=\"formaction\" value=\"update\">"+CreateFormPassword()+"<input type=\"hidden\" name=\"chkidentityid["+countstr+"]\" value=\""+id+"\">"+SanitizeOutput(CreateShortIdentityName(name,publickey))+"</td>";\r
+ content+="<td title=\""+publickey+"\"><form name=\"frmupdate\""+countstr+"\" method=\"POST\"><input type=\"hidden\" name=\"formaction\" value=\"update\">"+CreateFormPassword()+"<input type=\"hidden\" name=\"chkidentityid["+countstr+"]\" value=\""+id+"\">";\r
+ if(identityidstr!="")\r
+ {\r
+ content+="<a href=\"peerdetails.htm?identityid="+identityidstr+"\">";\r
+ }\r
+ content+=SanitizeOutput(CreateShortIdentityName(name,publickey));\r
+ if(identityidstr!="")\r
+ {\r
+ content+="</a>";\r
+ }\r
+ content+="</td>";\r
content+="<td>"+CreateTrueFalseDropDown("singleuse["+countstr+"]",singleuse)+"</td>";\r
content+="<td>"+CreateTrueFalseDropDown("publishtrustlist["+countstr+"]",publishtrustlist)+"</td>";\r
content+="<td>"+CreateTrueFalseDropDown("publishboardlist["+countstr+"]",publishboardlist)+"</td>";\r
\r
// get count of identities we are showing\r
sql="SELECT COUNT(*) FROM tblIdentity LEFT JOIN tblIdentityTrust ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID ";\r
- sql+="WHERE tblIdentity.Hidden='false' AND tblIdentityTrust.LocalIdentityID=?";\r
+ sql+="WHERE tblIdentityTrust.LocalIdentityID=? AND tblIdentity.Hidden='false'";\r
if(namesearch!="")\r
{\r
sql+=" AND (Name LIKE '%' || ? || '%' OR PublicKey LIKE '%' || ? || '%')";\r
\r
sql="SELECT tblIdentity.IdentityID,Name,tblIdentityTrust.LocalMessageTrust,PeerMessageTrust,tblIdentityTrust.LocalTrustListTrust,PeerTrustListTrust,PublicKey,tblIdentityTrust.MessageTrustComment,tblIdentityTrust.TrustListTrustComment,COUNT(MessageID) AS 'MessageCount',tblIdentity.PublishTrustList ";\r
sql+="FROM tblIdentity LEFT JOIN tblIdentityTrust ON tblIdentity.IdentityID=tblIdentityTrust.IdentityID LEFT JOIN tblMessage ON tblIdentity.IdentityID=tblMessage.IdentityID ";\r
- sql+="WHERE tblIdentity.Hidden='false' AND tblIdentityTrust.LocalIdentityID=?";\r
+ sql+="WHERE tblIdentityTrust.LocalIdentityID=? AND tblIdentity.Hidden='false'";\r
if(namesearch!="")\r
{\r
sql+=" AND (Name LIKE '%' || ? || '%' OR PublicKey LIKE '%' || ? || '%')";\r
#include "../include/optionssetup.h"\r
#include "../include/db/sqlite3db.h"\r
+#include "../include/global.h"\r
\r
#include <Poco/Message.h>\r
\r
upd.Reset();\r
\r
st.Bind(0,"FMSVersionEdition");\r
- st.Bind(1,"19");\r
+ st.Bind(1,FMS_VERSION_EDITION);\r
st.Step();\r
st.Reset();\r
upd.Bind(0,"Program");\r