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.


In reply to RE: Don't allow duplicate posts with the same title by turnstep
in thread Don't allow duplicate posts with the same title by princepawn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.