Additional anti-spam feature in Gbook module

  Previous article Next article  

Additional anti-spam feature in Gbook module

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.3.1
  Last updated: 18-01-2017
  Comments: 0

The Gbook guestbook module for CMS Made Simple™ has a built-in anti-spam feature. It uses the b8 statistical (Bayesian) spam filter. At one of my websites where I use the GBook module I noticed spammers are getting more clever trying to by-pass the filter and it leaves me more work checking ham or spam...

I found a really simple method to hide and show the form. When there is no form, a bot can't fill it in...

  How to use

Open the guestbook content page in the Admins page-editor and set WYSIWYG off in the Options tab.
Replace the GBook tags with the following code:

{$showform = $smarty.get.showform|default:''}

{if $showform == '1'}
  {Gbook|replace:"{root_url}/guestbook":"{root_url}/guestbook?showform=1" action='form'}
{else}
  <p><a href="{$page_alias}?showform=1" rel="nofollow">Show the form</a></p>
{/if}

{Gbook}

Note: Change the URL's in the code above to the one of your guest book page!

Basically it takes these steps:
  • Read the "showform" parameter from page URL
  • Only show the form when having the showform parameter in the page URL and the value is 1
  • If not show the message button, when clicked it reloads the page *with* the showform parameter
  • Show the current guest book entries

Afterwards you can always change the parameter name and/or the value. Or even set the date ( {$smarty.now|date_format:"%e"} is now 20 ) as value, so it changes every day... Let your imagination run wild :)

  Working example

Show the form »



A2 Webhosting CMS Made Simple

  Comments

  Click here to leave a comment






This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)
  « Enter the CAPTCHA code (lower case)

Your IP address will be stored on submit. I reserve the right to change or delete your response without notice!
In case of abuse your IP address will be blocked!


Can I have your attention for a moment?

Did this tutorial help you solving a problem at your (clients) website and it saved you many hours of work? Great!!
Consider buying Rolf a cup of coffee in return! [ Click here ]


  0 Comments

No comments yet...

CMS Made Simple 2.2.3.1 - Tutorials, tips and tricks - CMSMS 2.2.3.1

Additional anti-spam feature in Gbook module

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.3.1
  Last updated: 18-01-2017
  Comments: 0

A2 Webhosting CMS Made Simple