SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Helsingborg, Sweden
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The topic sais it all. Could someone please explain exactly how this works in vBulletin?

    I just tried to double post over on vBulletin.com and got a message that I had to wait 60 seconds. Fine, but when I posted the same message again a minute later it seemed to go well, but there was only 1 message in the thread. Is this some kind of flood protection? Shouldn't the user be informed that he tried to "double-post"?
    "Some people play hard to get - I play hard to want."

  2. #2
    Non-Member
    Join Date
    Apr 2000
    Location
    Waco, Texas.
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have never looked at the code, but I think it would be based on a cookie For example a cookie is set for 60 seconds, and if it is still 'alive' when you try and post again, you will get the error message.


  3. #3
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe it just looks at the last time you posted (which is recorded in the User table) and then if that is less than x seconds before now it won't let you post.

  4. #4
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The forums I regularly post on have a limit of 10 seconds, and even that has caught me out on occasions (I often have multiple browser windows open and may be composing 2 or more posts at the same time). I would like to see flood protection that works on a basis of checking if a previous thread in the post by the same author had exactly the same content - if so then don't let them post it again.

    One flood protecting element we have implemented on forums.gameplay.com is a simple javascript which 'greys out' the submit button after it has been clicked. The idea behind this is that double posting (whether deliberate or by accident) is rendered impossible (or at least difficult) as the first click of the submit button disables it instantly. Unfortunately this technique only works on IE, but as most of our visitors are using IS and Netscape users can still use the 'submit' button this is not so much of a problem.

  5. #5
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Skunk, could you post that code to grey out the button please, as I wouldn't mind impletementing it on my forums?

    Also, does anyknow know how to change the button to read something else after it has been clicked?

    Thanks.

  6. #6
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here ya go (I adapted this from somewhere else and have lost track completely of where it originated - it was 'in the public domain' at that point though so there's no copyright problems attached):
    Code:
    <script>
    <!-- Script to only allow users to hit submit once
    function submitonce(theform){
    //code to stop it from breaking opera
    if (navigator.appName!="Netscape")
    {
    //if IE 4+ or NS 6+
    if (document.all||document.getElementById){
    // cycle through every element in the form, and hunt down "submit" button
    for (i=0;i<theform.length;i++){
    var tempobj=theform.elements[i]
    if(tempobj.type.toLowerCase()=="submit"&&tempobj.name.toLowerCase()=="submit")
    // disable it
    tempobj.disabled=true;
    }
    }
    } else {
    return true;
    }
    }
    -->
    </script>
    Replace theform with the name of your form (i.e the something in <form name=something>) or if the form hasn't got a name give it one. You also need an onsubmit bit in the form tag - our form tag looks like this:
    Code:
    <FORM ACTION="newreply.php" NAME="REPLIER" METHOD="POST" onsubmit="submitonce(this)">
    Cheers,

    Skunk

  7. #7
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Skunk,

    I have implemented that on my new reply template and have also implemented an option that changes the button to read "Posting New Reply" which is greyed out.

    Thanks agian.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •