On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Extended by: Jelle Jager (TobyL) September 2006
    • Hi microchip,

      i'm trying to fight off SPAM with my JOT forms and I'm wasn't able to get your code below to work. It seems that once I modify the jot.class.inc.php file the pages won't load. Wondering if there is something that I'm missing?

      Open jot.class.inc.php and add this on line 547:
      
      //-- Honeypot
      if ($saveComment && !empty($_POST['body'])) {
          $this->form['error'] = 10;
          unset($pObj);
          return;
      }
      
      
      In jot template add this error: &10=I believe you're a bot
      
      [+form.error:select=`
      &-3=You are trying to re-submit the same post. You have probably clicked the submit button more than once.
      &-2=Your comment has been rejected.
      &-1=Your comment has been saved, it will first be reviewed before it is published.
      &1=You are trying to re-submit the same post. You have probably clicked the submit button more than once.
      &2=The security code you entered was incorrect.
      &3=You can only post once each [+jot.postdelay+] seconds.
      &4=Your comment has been rejected.
      &5=[+form.errormsg:ifempty=`You didn't enter all the required fields`+]
      &10=I believe you're a bot. 
      `+]
      
      
      And somewhere in the form the html for the honeypot field
      
      <label id="bodyhp"><span>Body</span><br /> 
      <input class="form-input" name="body" type="text" value="" id="body" />
      </label>
      
      
      Finally some CSS to hide the form:
      
      label#bodyhp {
          display: block;
          height: 1px;
          overflow: hidden;
          padding-top: 1px;
      }