Fork me on GitHub
Current releases are 2.1 (gold) and 2.0.18.11 (security patch for 2.0)
Ready for 2.1? Find out if your favorite plugins are compatible.
The 2.0 branch will no longer receive updates after Dec 2014.

Stopping Duplicate Posts

hbfhbf wiki guy? MVP
edited December 2011 in Vanilla 2.0 Help

Right now there is nothing from preventing people from posting the same message multiple times on a single thread (discussion). It's a bit of a nuisance since sometimes it occurs by accident, like if you hit the submit button a few times.

I've searched but haven't found anything yet, but does anyone know of a way to restrict users from reposting the same message two time in a row? I don't mind if they post the same thing twice, just not consecutively within a short time period.

Comments

  • edited December 2011

    In your dashboard, under Forum ------>Flood Control

    That will prevent accidents.

  • jspautschjspautsch Themester ✭✭✭

    Douglas_Thor said: In your dashboard, under Forum ------>Flood Control

    That will prevent accidents.

    Not really, the best you could do is set it up to allow 1 comment every 30 seconds, and then put them on a 1 minute posting block, but that seems pretty brutal just to avoid the occasional double-post.

  • 422422 Developer MVP

    Another way would be to ping the db, for user id and title duplicate as part of a validation rule.

    Most spammers post same title multiple times, for new threads.

    For posts, i would use usercount and userid, so if user has less than three posts they are limited to delay as jonathn said, this would need a usergroup trigger to lift the restriction... Not ideal but dooable, or unil thy reach ten posts hey must use recaptcha

    422 Real Estate Australia , now open Check it out

  • x00x00 MVP
    edited December 2011

    What you are talking about is something called heuristics. It might be reasonable for new users, as you go on you might have to keep it simple, to not have so much of a performance hit.

    Most spammers post same title multiple times, for new threads.

    I dispute, that, often they reply to threads. Though same text is common. smart spammers will do anything to beat the filter.

    There are another solution that could be to do with preventing double submission. There already is a server solution, but I can also think of a client solution.

    grep is your friend.

  • jspautsch said:

    Douglas_Thor said: In your dashboard, under Forum ------>Flood Control

    That will prevent accidents.

    Not really, the best you could do is set it up to allow 1 comment every 30 seconds, and then put them on a 1 minute posting block, but that seems pretty brutal just to avoid the occasional double-post.

    I have mine set up to allow one post or comment every 60 seconds. If my users are posting any faster than that, they're spamming..

  • RainulfRainulf New
    edited December 2011

    @hbf I was having the same problems. However, there's no duplicate in actual post, just the way it appends it in the current page via js - it appends it twice. I noticed that this happens most of the time when the loadtime is high

  • 422422 Developer MVP
    edited December 2011

    @rainulf are you running lots of queries ,js wise..?

    422 Real Estate Australia , now open Check it out

  • hbfhbf wiki guy? MVP

    Rainulf said: @hbf I was having the same problems. However, there's no duplicate in actual post, just the way it appends it in the current page via js - it appends it twice. I noticed that this happens most of the time when the loadtime is high

    im seeing the dups after refresh and it's adding to the user total post count so i don't think its just a client side js issue.

    it's really obvious if you enable the ctrl-enter add-on.. do that, type a comment and hold ctrl while hitting enter a few time rapidly... you'll see the result.

    spam blocking will weed out too much. i just want to strip off true duplication.

    if anyone has a design in mind for an add-on, im all ears (eyes)

  • @422 nah, nothing.. the thing is, my server was having load issues cuz of some other stuff i was running.. i think the js does ajax calls multiple times.. assumes that if it doesnt receive response in a certain period, it's going to do another ajax call .. or something like that, im just guessing at this point. xD

    @hbf, oh that's really a huge issue =O

    422
  • hbfhbf wiki guy? MVP

    Douglas_Thor said:

    jspautsch said:

    Douglas_Thor said: In your dashboard, under Forum ------>Flood Control

    That will prevent accidents.

    Not really, the best you could do is set it up to allow 1 comment every 30 seconds, and then put them on a 1 minute posting block, but that seems pretty brutal just to avoid the occasional double-post.

    I have mine set up to allow one post or comment every 60 seconds. If my users are posting any faster than that, they're spamming..

    my forum has a "dark side" that is more chat room with history than forum. i want to keep the banter going because it engages my community.

  • hbf said:

    my forum has a "dark side" that is more chat room with history than forum. i want to keep the banter going because it engages my community.

    Thats a good point. I will have to keep an eye on my users for complaints and adjust it as needed.

  • hbfhbf wiki guy? MVP
    edited March 2012

    ok, so after a long period of not caring that much about this problem because my users had all figured out how to operate with "good" behavior, a new user renewed my interest in fixing this problem.

    so here it is. the issue is with the ctrl-enter plugin, but the fix is simple.

    replace the existing handler for after form buttons with this one

    
    public function DiscussionController_AfterFormButtons_Handler() {
            echo '< script type="text/javascript">';
            echo "$('#Form_Body').keypress(function(event){
                if((event.ctrlKey) && ((event.keyCode == 0xA)||(event.keyCode == 0xD)))
                    {
                    var theform = document.forms['Form_Comment'];
                    var butn = theform.elements['Comment/Post_Comment'];
                    var disabled = butn.disabled;
                if(disabled)
                    alert('Cut it out');
                else
                    $('#Form_PostComment').click();
                }
                })";
            echo '< /script>';
        }
    

    extraneous spaces added in the script blocks so they will show up.

Sign In or Register to comment.