in reply to Don't allow duplicate posts with the same title

One of the major problems with checking for "same post from same user" is that you have not taken into account anonymous monks. I wrote* a bulletin board (in Perl, naturally) and this is how I determine whether a post is a duplicate: if the previous post has the same title, and is from the same IP, it is marked as a duplicate and the person is encouraged to change the title if, indeed, they want to post it and it is not a duplicate.

This approach may not be ideal here, in a place where new posts can appear very quickly, but it's one way to do it. For this site, I think that using a combination of lastnode_id, IP, and title would be best: if all three match, consider it a duplicate post, no matter how long it has been. Having the lastnode_id addresses Ozymandius' concern, as long as you reply to the person, and not to the top node (which is what you should do). Having the IP addresses the issue of 2 different anonymous monks being able to post replies to the same post, with the same title. As a final perk, you could have a simple "yes, I really want to post this" checkbox along with duplicate post message.

In summary:

$IP = $ENV{'REMOTE_ADDR'}; ## Yes, there are caveats here... $lastpost = $lastpost{$IP}; ## Stored in a database ## ($lastpost is a hashref) if ( $user eq $lastpost->{"USER"} and $Q::lastnode_id == $lastpost->{"LASTNODE"} and $Q::node eq $lastpost->{"NODE"} and !$Q::PostAnywayCheckbox ) { &DoubledPost; }

*Wrote or "am writing"
Perl scripts: artwork that never
Assents to be done.

Replies are listed 'Best First'.
RE (tilly) 2: Don't allow duplicate posts with the same title
by tilly (Archbishop) on Sep 21, 2000 at 06:21 UTC
    That won't work well for a lot of corporate users. If someone uses a load balancer for outgoing posts then every post will come from an essentially random ID in some range.

    Instead lookup the last post on the user name. That should work much better for accidents (if not for spams).

      True, but most duplicate posts happen within a few seconds of each other, so it should work even for corporate users. More importantly, a lookup by user will not stop Anonymous Monks from double posting - hopefully, once you become a user, you are more aware of what you are doing and tend to make less mistakes. In reality, however, it seems as though registered users make double posts more often than AMs. Go figure.

        I think you misunderstood my point.

        My point is that corporate users behind a load balancer doing round robbin will have the separate posts come from sequential IPs, therefore your lookup by IP will fail to see the previous post for that user. While this is not common today, it is becoming more and more common as time goes by.

        Given the speed of double-posts and the frequency of posting overall, I also believe that it would work fine for anonymous users. If it would not then you could beef up the logic to take care of them specially.