0 Members and 1 Guest are viewing this topic.

*

CBG

  • *****
  • 952
    • osDate Forum
  • osDate Version: osDateEvo v1.2
Honeypot Mod - CBG
« on: December 18, 2017, 09:41:23 AM »
Mod Name: Honeypot
Version: 1.0

This mod should help toward stopping spam and bots signing up to your osDate site


First please BACKUP your files and database

Step 1.
Open phpMyAdmin and go to the database you have installed osDate into
- Click on SQL and put the following in the box, then click Go

Code: [Select]
INSERT INTO `osdate_glblsettings` (`config_variable`, `config_value`, `description`, `groupid`, `update_time`) VALUES ('mod_honeypot', 'Y', 'Enable Honeypot on the signup page', '1', NULL);


Step 2.
Open: admin/getglblsettings.php

Find:
Code: [Select]
case 'newvideo_admin_act_ltr':

After add:
Code: [Select]
case 'mod_honeypot':


Step 3.
Open: savesignup.php

Find:
Code: [Select]
/* PROMO CODE START */

Above Add
Code: [Select]
if ($config['mod_honeypot'] == 'Y' ) {
    $honeypot = isset($_POST['email'])?strip_tags(trim($_POST['email'])):'';

    if ($honeypot != '') {
        header ('location: signup.php?errid=121');
        exit;
    }
}


Step 4.
Open templates/default/signup.tpl

Find:
Code: [Select]
<input class="textinput" maxlength="255" name="txtemail" size="40" value="{$smarty.session.email}" />

After add:
Code: [Select]
{if $config.mod_honeypot == 'Y'}<input id="email_addy" maxlength="255" name="email" size="40" value="" />{/if}


If you are not using osDate Evo jump to Step 7

Step 5.
Open templates/default/css/desktop.css

At the bottom add
Code: [Select]
#email_addy{display:none;}


Step 6.
Open templates/default/css/mobile.css

At the bottom add
Code: [Select]
#email_addy{display:none;}


Step 7.
Open templates/default/default.css

At the bottom add
Code: [Select]
#email_addy{display:none;}

Notes
It is enabled by default, to turn it on and off, you need to go into the osDate Admin -> Site's Global Settings and scroll.
You should see: Enable Honeypot on the signup page click the pencil to turn it on or off.

To test it working, you need to make an edit, below is for testing only, make sure to remove it

Open templates/default/signup.tpl

Find:
Code: [Select]
{if $config.mod_honeypot == 'Y'}<input id="email_addy" maxlength="255" name="email" size="40" value="" />{/if}

Change to:
Code: [Select]
{if $config.mod_honeypot == 'Y'}<input id="email_addy" maxlength="255" name="email" size="40" value="abc" />{/if}
Regards,
CBG (Garry)
osDate: 2.6.5, & Evo
PHP: 5.6.x | MySQL: 5.5.34-cll

*

Pharg

  • *****
  • 2,928
    • OsDateFourm
  • osDate Version: osDateEvo v1.2
Re: Honeypot Mod - CBG
« Reply #1 on: December 18, 2017, 10:00:53 AM »
Hi CBG,

Thanks for the sharing this great mod, Nice work  :D


Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.2 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35