Just noticed you can post repeatedly with the same text. Or reply to a post with the same text. Or just hit back and have fun! I think that feature is pretty important for the public release.
Re: [Muhammad] No flood/duplicate post control...In reply to
It can easily be implemented by checking the title and description/post/message and UserID via querying the Post table. If there is an exact match, then serve up an error message or redirect to the forum where the user was at when he/she posted a topic.
I have this in my forum software built on LINKS SQL. ======================================== Buh Bye!
Re: [AnthroRules] No flood/duplicate post control...In reply to
Unfortunately it's not so easy - you can't do = with a TEXT/BLOB field on Oracle or MS SQL (not sure about postgres).
I think I'll have to use some sort of random ID that generates when you start to write a new post. Then if you attempted to post with the same ID, you would get an error message. Jason Rhinelander Gossamer Threads jason@gossamer-threads.com
Re: [AnthroRules] No flood/duplicate post control...In reply to
The problem is that the ID doesn't exist until after you have posted, so there is no way to pass the ID as form input since it doesn't exist yet... Hence a unique post id other than the primary post_id column. Actually, there already _is_ a temporary ID used for identifying which attachments go with which post, so it shouldn't be too big a modification - just a matter of storing it with the post. Jason Rhinelander Gossamer Threads jason@gossamer-threads.com
Re: [AnthroRules] No flood/duplicate post control...In reply to
The post_id isn't known until after the post has been inserted into the database, and is figured out when the post is inserted. To put the protection there, we would have to know the post_id BEFORE inserting it, which can't be done... After inserting, we can do whatever we want with the post ID, but there is no way to adjust the information that will be sent when the user pressed "reload" on their browser and resubmits the form data. Hence the need for a independant random post ID that is generated as soon as you start writing a post (or reply). Jason Rhinelander Gossamer Threads jason@gossamer-threads.com
Re: [Muhammad] No flood/duplicate post control...In reply to
You can always do it with some javascript. Well this would prevent multiple posts of the same post, but not different posts in a small interval of time...
Re: [AnthroRules] No flood/duplicate post control...In reply to
It gets the ID after the link is inserted. To know what the ID is going to be before even MySQL knows it is impossible. Jason Rhinelander Gossamer Threads jason@gossamer-threads.com
Re: [jagerman] No flood/duplicate post control...In reply to
Okay...still seems like if you pull the ID like the codes that Alex provided, you can add codes to query the POSTS table in the "process_form" sub that checks the ID.
I understand what you saying, but it still seems like an easy fix to check the ID added. ======================================== Buh Bye!
Re: [AnthroRules] No flood/duplicate post control...In reply to
Check it for what, though?
I make a post, and let's say it gets post_id '123'.
Then, I hit refresh on my browser, and that post gets '124'. Or maybe someone has posted in the meantime and it gets '125' - there's not really any way to know. No matter how many times you hit refresh, you are never going to get post_id '123' again, so there's no way it can be used. Jason Rhinelander Gossamer Threads jason@gossamer-threads.com
Re: [jagerman] No flood/duplicate post control...In reply to
I didn' read the whole post cause I am lazy, but if I was going to implement something to stop flooding the same message I would have a "Post Session" table, and store the MD5 hash of the message in there.
When you submit the post it does an MD5 of the message and compares it to posts in the "Post Session" table, and if the same message has been posted in the last 5 mins, don't let it go through...
Anyway - Thats an easy way to do it cause you are dealing with strings that are 32 characters long, rather then a huge post.
Re: [jagerman] No flood/duplicate post control...In reply to
When someone tries to submit a duplicate post, you should put an error message like "You have already submitted your post" or redirect the user to the Post that they submitted. ======================================== Buh Bye!
Re: [Muhammad] No flood/duplicate post control...In reply to
Welp, I guess not...I thought that when I posted a post and tried submitting it again, it didn't appear, but after refreshing the forum page, the duplicate post appeared...
Oh well...may be Jason will add it soon. ======================================== Buh Bye!
Re: [Michael_Bray] No flood/duplicate post control...In reply to
Quote:
When you submit the post it does an MD5 of the message and compares it to posts in the "Post Session" table, and if the same message has been posted in the last 5 mins, don't let it go through...
What about a flood of 'me too' posts. ;) Guess include a check by the same user. Not sure I like the idea of having to md5 the entire message.