The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
I wrote this in response to a problem with double posting, thanks to a suggestion by PierreTopping. Basically, this mod adds a checksum value to topics and replies. When a post is made, it compares the checksum values of previous posts by the same member within the last 10 days. If it finds a match, the post is not made. Get your copy at SnitzBitz.
Note: The original CRC calculation was created by someone else, but the claimed "copyright" allows incorporation for free into existing code; provided the code is not listed on a website.
Note: The original CRC calculation was created by someone else, but the claimed "copyright" allows incorporation for free into existing code; provided the code is not listed on a website.
آخرین ویرایش توسط
نوشته شده در
Note: The original CRC calculation was created by someone else, but the claimed "copyright" allows incorporation for free into existing code; provided the code is not listed on a website.
Could you not have just used the forums SHA256 function to do this ?
نوشته شده در
Sure, but we'd end up with another long encrypted text area field. This field is only 255 characters and will probably never exceed 15.
نوشته شده در
A sha256 is 256 bits long -- as its name indicates.
If you are using an hexadecimal representation, each digit codes for 4 bits ; so you need 64 digits to represent 256 bits -- so, you need a varchar(64), or a char(64), as the length is always the same, not varying at all.
If you are using an hexadecimal representation, each digit codes for 4 bits ; so you need 64 digits to represent 256 bits -- so, you need a varchar(64), or a char(64), as the length is always the same, not varying at all.
نوشته شده در
The longest checksum I've been able to create was 10 characters; even with a post of over 15000 characters. Switching it to sha256 would eliminate any potential copyright issue, so should probably do so if it will be incorporated into base code in the future.
نوشته شده در
as long as the CRC code copyright allows us to use it, it shouldn't be a problem, just wondered why you didn't use the sha256 function that was all, but definitely better to store 10 rather than 64 chars, possibly worth changing the dbs script to create a smaller field though if you don't think it will need 255.
نوشته شده در
Another suggestion, Carefree, if you don't mind.
In both SELECT statements for retrieving topics and replies to test, you are using SELECT *, but then you only use the T_CHKSUM and the R_CHKSUM fields. SELECT * is an horrible statement, performance wise, so I would just use the specific fields in those two statements.
In both SELECT statements for retrieving topics and replies to test, you are using SELECT *, but then you only use the T_CHKSUM and the R_CHKSUM fields. SELECT * is an horrible statement, performance wise, so I would just use the specific fields in those two statements.
نوشته شده در
No problem. Easy to change. Done and updated.
آخرین ویرایش توسط
نوشته شده در
Is there any chance you can post the changes above to this thread for those that have already implemented it ?
نوشته شده در
Sure. Implementing the change to the field size, though, would require you to rerun a dbs file.
"post_info.asp"
"dbs_chksum_fieldsize.asp"
"post_info.asp"
Code:
Look for the following line (appx 825):
strSql = "SELECT * FROM " & strTablePrefix & "TOPICS WHERE (T_AUTHOR="&MemberID&" AND T_DATE>='" & strDate10 & "' AND T_CHKSUM>'') ORDER BY T_DATE DESC"
Change it to say:
strSql = "SELECT T_CHKSUM FROM " & strTablePrefix & "TOPICS WHERE (T_AUTHOR="&MemberID&" AND T_DATE>='" & strDate10 & "' AND T_CHKSUM>'') ORDER BY T_DATE DESC"
Look for the following line (appx 1076):
strSql = "SELECT * FROM " & strTablePrefix & "REPLY WHERE (R_AUTHOR="&MemberID&" AND R_DATE>='" & strDate10 & "' AND R_CHKSUM>'' AND TOPIC_ID=" & Topic_ID & ") ORDER BY R_DATE DESC"
Change it to say:
strSql = "SELECT R_CHKSUM FROM " & strTablePrefix & "REPLY WHERE (R_AUTHOR="&MemberID&" AND R_DATE>='" & strDate10 & "' AND R_CHKSUM>'' AND TOPIC_ID=" & Topic_ID & ") ORDER BY R_DATE DESC"
"dbs_chksum_fieldsize.asp"
Code:
ChkSum v3.4.07 Field Size Change
[ALTER]
TOPICS
ALTER#T_CHKSUM#VARCHAR(16)#NULL#
[END]
[ALTER]
REPLY
ALTER#R_CHKSUM#VARCHAR(16)#NULL#
[END]
آخرین ویرایش توسط
نوشته شده در
The dbs file returns errors with a MySql database Carefree....
Adding Column T_CHKSUM... ALTER TABLE FORUM_TOPICS ALTER COLUMN T_CHKSUM varchar(16) NULL
ALTER TABLE FORUM_TOPICS ALTER COLUMN T_CHKSUM varchar(16) NULL
-2147217900 | [MySQL][ODBC 5.1 Driver][mysqld-5.1.56-community]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(16) NULL' at line 1
--------------------------------------------------------------------------------
Adding Column R_CHKSUM... ALTER TABLE FORUM_REPLY ALTER COLUMN R_CHKSUM varchar(16) NULL
ALTER TABLE FORUM_REPLY ALTER COLUMN R_CHKSUM varchar(16) NULL
-2147217900 | [MySQL][ODBC 5.1 Driver][mysqld-5.1.56-community]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(16) NULL' at line 1
Email Member
Message Member
Post Moderation
بارگزاری فایل
If you're having problems uploading, try choosing a smaller image.
پیشنمایش مطلب
Send Topic
Loading...