Advertisement:

Author Topic: [Tip/Trick] Blocking bots from comment posting  (Read 12597 times)

blast

  • Jr. Member
  • **
  • Posts: 62
Re: [Tip/Trick] Blocking bots from comment posting
« Reply #30 on: March 30, 2014, 04:52:22 am »
Since we can't see the honeypot field and I'm good at coding.

Can anyone verify that I have done the following correctly in adding this honeypot field to the "Contact Publisher"...


1 - add the following to theme item-sidebar.php
Code: [Select]
<input id="spamlover" name="spamlover" value="" />
2 - add the following to the theme style.css
Code: [Select]
/*we love spam */
#spamlover {display:none }

3 - add the following to oc-includes/osclass/itemactions.php
Code: [Select]
$spam           = $_POST['spamlover'];
if ($spam === "") {} else {
                Session::newInstance()->_setForm('commentAuthorName', $authorName);
                Session::newInstance()->_setForm('commentTitle', $title);
                Session::newInstance()->_setForm('commentAuthorEmail', $authorEmail);
                Session::newInstance()->_setForm('commentBody', $body);
                return -1;
             }


Thank you